question

Upvotes
Accepted
7 2 0 4

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-sdkrrtema-apielektron-message-api
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
9.5k 10 5 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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea