question

Upvotes
Accepted
7 4 0 5

What is the best practice for establishing an OmmConsumer connection?

Opening/closing for each request or keeping a single client connection open for the life of the application to be used for all requests?

If only a single connection is required, is there anything that needs to be closed?

We use the batch process and the uninitialize() does not work. Does the batch process close the session on its own?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
icon clock
10 |1500

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

Monitored by @Pimchaya.Wongrukun

1 Answer

· Write an Answer
Upvotes
Accepted
9.6k 10 7 7

Hello @joe.hong

Normally, a single connection is used to get data from a server. The simple workflow to use batch request is

  1. EMA Java application connects to the server and login.
  2. it sends a batch request to ADS.
  3. ADS responds by sending the items as if they were opened individually as shown in the figure below:

4. the application processes data messages sent from ADS.

Before the application exits, it should logout and closes all items. These can be done by calling OmmConsumer.uninitialize() as mentioned in the EMAJ_DevGuide.pdf shown below:

When OmmConsumer.uninitialize() is called, EMA sends a request to close the login stream(logout) for the session/connection to the server. Then, all item opened under the session/connection are closed. Hence, the application does not need to send close request for each item stream.

Please see the example370__MarketPrice__Batch which demonstrates how to use of batch request and close session.


batchreq.png (20.5 KiB)
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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