question

Upvotes
Accepted
1 0 1 2

how to make EmaFactory to connect with the second host if the first host can not be connected

Hi, We are using the thomson-reuters-ema java api (version 3.5.1.0) to connect the EAM server. Recently we got a lot of errors like:


loggerMsg

ClientName: EmaConsumer_287

Severity: Error

Text: login failed (timed out after waiting 45000 milliseconds) for xxxxxxxx.europe.intranet:14002)

loggerMsgEnd


It turned out that a particular server was in maintenance. The others configured servers in hosts should be functioning. However, the EmaFactory is always trying to connect with the first host, and did not try the other hosts in the host list.


This log is generated by the EmaFactory, which cannot be modified by us. So the question is, how to let the EmaFactory only try once for the connection of each host? If it failed, then try another host? Currently it seems that the EmaFactory is always trying to connect with the first host in the host list.


Below is our code to connect to the EMA host, thanks.

--------------------------------------------------------------------

private OmmConsumer getOmmConsumer() {

OmmConsumer consumer;

for (String host : hosts) {

try {

LOGGER.debug("Start to connect with Trep Server: {} --- {}", host, user);

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();

consumer = EmaFactory.createOmmConsumer(config.host(host).username(user).applicationId(APPLICATION_ID));

return consumer;

} catch (OmmException exception) {

LOGGER.warn(exception.getMessage());

}

}

return null;

}


elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apirefinitiv-realtime-sdk
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

@ning.kang

OmmConsumerConfig.host(String) is to specify a hostname and port that EMA will connect to so it does not accept multiple hosts. You may need to use ChannelSet, as described in the following post instead.

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
11.5k 16 7 10

Hello @ning.kang

There is also the Enterprise Message API (EMA) - Configuration Overview article that will give you an explanation regarding EMA Config file. Please refer to "Channels and ChannelSets" section in the article.

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.

Click below to post an Idea Post Idea