Im trying to process error handling for channel disconnections and errors. I can see that the Eleketron already logs an error containing the info that I want but the StatusMsg that I receive from the OmmConsumerClient do not have this info.
Below is what logs I see from the Elektron logs. I want to be able to get the Text containing Channel_1 and Channel_2 as well as the connection refused..
WARN 2020-02-11 06:08:37.199-0600 OmmConsumerImpl [pool-3-thread-1]- loggerMsg ClientName: ChannelCallbackClient Severity: Warning Text: Received ChannelDownReconnecting event on channel Channel_2 RsslReactor @5aaf0534 RsslChannel @3c5be0d Error Id 0 Internal sysError 0 Error Location Reactor.processWorkerEvent Error text Error initializing channel: errorId=-1 text=Connection refused loggerMsgEnd ERROR 2020-02-11 06:08:42.206-0600 OmmConsumerImpl [pool-3-thread-1]- loggerMsg ClientName: ChannelCallbackClient Severity: Error Text: Received ChannelDown event on channel Channel_1 Instance Name ReutersConsumer_1 RsslReactor @5aaf0534 RsslChannel @5468f011 Error Id 0 Internal sysError 0 Error Location Reactor.processWorkerEvent Error text Error initializing channel: errorId=-1 text=Connection refused loggerMsgEnd
The StatusMsg that I received only tells that the channel has closed and does not tell which of the multiple channels is down.
WARN 2020-02-11 06:08:42.206-0600 LoginOMMConsumerClient [pool-3-thread-1]- Login state is not OK. State=Closed / Suspect / None / 'channel closed', Msg=StatusMsg streamId="1" domain="Login Domain" state="Closed / Suspect / None / 'channel closed'" name="DEV" nameType="1" StatusMsgEnd
I also just remembered that the OmmConsumerEvent has a channelInformation() / getChannelInformation() method which allows you to access various attributes of the Channel associated with that event.
That should make things easier - as you can just access this in the onStatusMsg() event handler
See this other post for some more information and discussion around this issue
Have you referred to the 170__MarketPrice__ChannelInfo examples available in the 100 Series folder of the EMA Examples that come with the Elektron SDK?
This demonstrates how to get the Channel information for each OmmConsumer instance.
Does this meet your requirement?
You may also be interested 422__MarketPrice__ErrorClient example in the 400 series folder which lets you capture errors using an Error Client.
I think it's a valid point and idea that you bring up, with multiple channels, this potentially may be a useful information to receive on channel closed.
EMA application tier code is not in control of status message content or wording.
Two approaches I can think of:
One is, to suggest this as an enhancement to Elektron SDK development team, you can reach them directly via Refinitiv Elektron SDK on GutHub. The enhancement request will be evaluated and if accepted, prioritized. Does this sound like what you would prefer, will you be able to proceed, or like us to create the request, on your behalf?
The other path comes from the fact that the library source code is available to you, Elektron SDK source code is included also on GitHub, and you are able to branch and modify locally, and rebuild, this you can do immediately, but we note that this approach requires more in-depth understanding, time and effort. Once completed, you may wish to submit your enhancement to ESK development and it may be evaluated and accepted for the main code base, otherwise it will remain in your local branch only.
Please consider the suggestion by @Umer Nalla, as it looks to cover your use case:
getChannelInfo() call, from onStatusMsg calback, on disconnect, should provide you with the connection info for the channel, allowing to identify the broken channel?
While on the initial connection, on login, if the connection fails, getChannelInfo will be null, but at that point the application has a way of tracking what channel was requested by consumer?
EMA attempts to seamlessly recover on behalf of the application whenever possible, so with more then one channel on the ChannelSet, it will try the next channel on the channel set, exhaustively,
Prior to tracking an enhancement, and yes, there is no separate enhancement request on GitHub so issue request is used to track.