question

Upvotes
Accepted
87 4 4 11

[EMA C++]how to set username and date backup in EmaConfig.xml

hello:

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

EmaConfig.

thank you.emaconfig.txt

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
emaconfig.txt (17.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
7.6k 15 6 9

@luxiangyuan
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 ); 
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7.6k 15 6 9

@luxiangyuan
#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 4.4.1.1 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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1、I use the OmmConsumerConfig now, and I know how to set the username;

but for the "Connection Failover" function, I must use the EMAConfig.xml other than the OmmConsumerConfig, and I also found the application use the username of Linux.

so I want to know the offical method to set username when use EMAConfig.xml

2、 yes,what I mean is Connection Failover, I get it, thank you .

Click below to post an Idea Post Idea