question

Upvotes
Accepted
28 4 0 5

Data Streaming - Auto logout ("Login stream was closed.")

Hi,

I am trying to streaming data via EMA. However, I got "Login stream was closed." warning message after receiving several messages. May I know how can I keep connected and keep streaming data.

Thanks.

Regards,

Jun

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apilog-out
capture.png (33.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.

1 Answer

Upvotes
Accepted
13k 32 12 18

@hujunhu EMA has two event dispatch mechanism - one where the user thread is responsible for event dispatches (OperationModel.USER_DISPATCH), and another one where API will auto dispatch (OperationModel.API_DISPATCH). In the auto dispatch mechanism, the application should keep main thread alive - which is done in the EMA example with the Thread.sleep() call after registering an item interest with OMMConsumer.

If this main thread terminates, the example uninitializes the consumer and terminates the application - which seems to be the case here. You can wrap this Thread sleep in a loop to prevent it from terminating, or use user dispatch mechanism as shown in series100\example130__MarketPrice__UserDisp example.

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 Gurpreet, Thanks for your help.I wrapped it into loop and it works.

Can you explain a bit more on API_DISPATCH and USER_DISPATCH? API_PATCH is passive feed and USER_DISPATCH is active query?

Thanks.

The event dispatch mechanism is described in Section 2.4.1 - EMA Consumer Architecture. See API/User dispatch in EMA developers guide.

Click below to post an Idea Post Idea