question

Upvotes
Accepted
58 5 10 9

EMAJ: How to keep long connection to server in OMMConsumer?

I have decoded the data from the host in Consumer. But how to keep a long connection to the host? such as heartbeat sending(I found it by using channel.ping() in ETAJ doc, but I don't konw how to do in EMAJ Consumer). Will the host send heartbeat package? if yes, how to deal with it?

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijavaconnection
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 Answer

Upvotes
Accepted
1.9k 6 9 16

Hello @Raj.Huang,

EMA Java provides the ping management via its underlying layer (i.e. ETA Java). That's why you can't see this topic in EMA Java.

The only option is that you can specify the ping or heartbeat value through the EMA Java's configuration parameter named 'ConnectionPingTimeout' as you can see its detail in the EMAJ_ConfigGuide.pdf document (see the excerpt below).

Anyway, there is a concern regarding ping management from ETA_DevGuide.pdf as follows:

According to the document, the server's minPingTimeout seems to have a higher priority when the application tries to negotiate the final ping value anyway.

Hope this helps!


etaj-devguide.png (110.0 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.

Hi @Nipat Kunvutipongsak,

Thanks for your reply. I got it!

But when the server disconnects, what will EMAJ consumer do?

Will EMAJ send some exceptions out(maybe ErrorClient.class)? Thus I can know the connect is broken, then I can do something to reconnect.

Or will EMAJ help me reconnect when it detects disconnection?

Thanks if getting your reply!

Hi, I got the answer from Wasin Waeosri, it will reconnect itself, thank you all!

Click below to post an Idea Post Idea