I develop as a consumer with EMA C++.
I use the config file EmaConfig.xml shown as the appendix.
my question is:
1、how to set the username in the EmaConfig?
now I fund the program use the username (get through com whoami) of the machine where the program runing.
2、how to set backup of data source?
for example, I get date form ip1 and ip2, ip2 is backup of ip1, how to set ip1 and ip2 in the file
You can't specify the OMM Login in EmaConfig.xml file but as I said previously you have to set it in your application using OmmConsumerConfig class.
Basically, the class provide method addAdminMsg which you can specify a login request message to override the default login request. You can also use the class to specifies information for the Administrative domain(Login, Directory, Dictionary) request message used by EMA.
EMA will read the connection or channel details from the EmaConfig.xml and then use the login details you set in the applications instead. The application may read the login information from command line arguments or using your own configuration file.
Below is sample codes to use the class based on 420__MarketPrice__AdminDomainConfig example.
OmmConsumer consumer(OmmConsumerConfig() .operationModel(OmmConsumerConfig::ApiDispatchEnum) .addAdminMsg(ReqMsg() .domainType(MMT_LOGIN).name("username").nameType(USER_NAME) .attrib(ElementList().addAscii(ENAME_APP_ID, "127") .addAscii(ENAME_POSITION, "127.0.0.1/net") .addUInt(ENAME_ALLOW_SUSPECT_DATA, 1) .complete()))); consumer.registerClient( ReqMsg().serviceName( "API_ELEKTRON_EDGE" ).name( "JPY=" ), client );
#1 Do you mean the username for OMM Login?
If so, EMA does not have the configuration for setting the username in EMAConfig.xml, it's responsible for the Application to pass the username using OMMConsumerConfig class. Please refer to section 188.8.131.52 OmmConsumerConfig Class Function Calls from EMACPP_ConfigGUide.pdf. Please note that If the username is not set, the application extracts a username from the run-time environment which might be the username of your Windows or Linux.
#2 Do you mean Connection Failover? Please refer to this post for sample ChannelSet config for the failover.