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?
Normally, a single connection is used to get data from a server. The simple workflow to use batch request is
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.
Have created server side solution using EMA API for fetching prices. The service gets stalled after sending batch request with exception noted below. The issue occurs intermittently and required restart of application.