question

Upvotes
Accepted
1 0 0 2

[EMA C++] How to recover the subscription of market data when the statusmsg returns a Closed stream state?

The connection to the EED server is ok. However,the OnStatusMsg method shows that the stream state for each market data item is closed and I attempt to recover the subscription of each item. The result of the attempt is that the stream state is also closed. But when I reopen my application mannually, the stream state is ok. Can you tell me how to recover the subscription of market data when the OnStatusMsg returns a Closed stream state and why a reconnection to the EED server can solve that problem?

My OnStatusMsg method is as below.

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apipricingstream
3640-code.jpg (91.3 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.

1 Answer

· Write an Answer
Upvotes
Accepted
25.3k 87 12 25

Hi @zhouzhengxin

Can you confirm what value is reported for the StatusCode and StatusText? This may help understand the reason/cause of the close stream.

In terms of programmatic recovery, how soon after the Closed do you try to re-request the item? And if so, how many times do you try before abandoning?

It is usually good practice to wait a few seconds, before re-requesting and if making more than one retry attempt, wait a bit longer between each attempt - and then aborting the attempts after 2-3 attempts.

Also, just to confirm, are you actually connecting direct to the Elektron Edge Server (EED) or are you connecting via TREP i.e. ADS server?

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.