Client is facing bellow ERROR sometimes which caused ChannelDown. And client can only restart the apps manually to subscribe data again. Client is asking how to capture the message of reactorChannelEventCallback, then they can reconnect automatically.
Text: Received ChannelDown event on channel Channel
Instance Name EmaConsumer_1
Error Id -1
Internal sysError 0
Error Location WlItemHandler.dispatch
Error text ReactorCallbackReturnCodes.FAILURE was returned from defaultMsgCallback(). This caused the Reactor to shutdown.
Just to confirm - to know the state of connectivity, you need to monitor the Status Msg for the Login Stream - not the market data item streams such as MarketPrice or others.
@gang.chen1 - regards your other question about - Received an item event with invalid message stream - this was asked previously by yourself: Received an item event with invalid message stream - Forum | Refinitiv Developer Community
There is a related question on the forum - EMA C++ - Reconnection to ADS - Forum | Refinitiv Developer Community - which explains how to monitor the connection state and also EMA Webinar Nov 2: How are connection events handled (disconnections, buffer overflows, etc) - Forum | Refinitiv Developer Community
if you want to know the state of connectivity to a server within the application, you can manually register for the Login Domain stream.
Please refer to the 330__Login__Streaming example that comes with the SDK.
So, for example, if the DataState of your Login stream changes to Suspect, you know something is not right - but as long as the StreamState remains open - this should recover to DataState of OK. If however, it has not recovered after a while, you could try and reconnect.
OR, If the StreamState changes to Closed, then this indicates that the application has been logged out of the server and you would need to reconnect.
Since we added StreamState into monitoring, we got so many StatusMsgs with StreamState[CLOSED] as below
2022-05-18T15:20:33,874 ERROR 23600 [pool-5-thread-1] EmaClient 53 onStatusMsg - StreamState[CLOSED] in StatusMsg streamId="7" domain="MarketPrice Domain" state="Closed / Ok / None / 'Stream closed for batch'" serviceName="ELEKTRON_DD" StatusMsgEnd 2022-05-18T15:20:33,883 ERROR 23609 [pool-5-thread-1] EmaClient 53 onStatusMsg - StreamState[CLOSED] in StatusMsg streamId="9" domain="MarketPrice Domain" state="Closed / Ok / None / 'Stream closed for batch'" serviceName="ELEKTRON_DD" StatusMsgEnd ...
While subscribing to Chain of LSE : [0#LSE-ALL] and Chain of SGX : [0#A.SI, 0#B.SI, 0#C.SI, 0#D.SI, 0#E.SI, 0#F.SI, 0#G.SI, 0#H.SI, 0#I.SI, 0#J.SI, 0#K.SI, 0#L.SI, 0#M.SI, 0#N.SI, 0#O.SI, 0#P.SI, 0#Q.SI, 0#R.SI, 0#S.SI, 0#T.SI, 0#U.SI, 0#V.SI, 0#W.SI, 0#X.SI, 0#Y.SI, 0#Z.SI]
We wonder if it is normal and what could be the possible reasons for this...