How to determine which channel is down and reason in StatusMsg

Hi,

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


Thanks

Best Answer

  • Hi @kc_1905

    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

Answers

  • Hi @kc_1905

    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.

  • Hello @kc_1905,

    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.


  • Hi, I checked the channelInformation from the consumer event but I think it only applies when the initial connection has been established.

    If it cant connect for first time the channel info details like host values returns null.

    StatusMsg will only have Channel Down description

    Logs below uses "localhost:14002" host and port in Channel config

    WARN 2020-02-12 09:01:21.636+0000 OmmConsumerImpl [main]- loggerMsg
        ClientName: ChannelCallbackClient
        Severity: Warning
        Text:    Received ChannelDownReconnecting event on channel Channel_1
        RsslReactor @15d49048
        RsslChannel @7098b907
        Error Id 0
        Internal sysError 0
        Error Location Reactor.processWorkerEvent
        Error text Error initializing channel: errorId=-1 text=Connection refused
    loggerMsgEnd


    INFO 2020-02-12 09:01:21.645+0000 LoginOMMConsumerClient [main]- CHANNEL INFO
    hostname: null
        IP address: null
        connected component info: null
        channel state: closed
        connection type: unknown
        protocol type: unknown wire format
        major version: 0
        minor version: 0
        ping timeout: 0
       
    WARN 2020-02-12 09:01:21.649+0000 LoginOMMConsumerClient [main]- Login state is not OK. State=Open / Suspect / None / 'channel down', Msg=StatusMsg
        streamId="1"
        domain="Login Domain"
        state="Open / Suspect / None / 'channel down'"
    StatusMsgEnd
  • Thanks. Ill check the error client and see I can capture more errors that I am after



  • Is enhancement request the same as "issue" ? Never worked with github before sorry.

  • Hello @kc_1905,

    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.

  • Yea, I will definitely use getChannelInformation for disconnects to try and retrieve information. I will just have to work with whats available at the moment.

  • Hi @kc_1905

    Thanks for the update.

    Just to reinforce my colleagues comment about using a ChannelSet - if you are not already doing so. This will allow the API to attempt connection to alternative servers at startup and if/when a connection is lost during runtime - on your behalf.

    EMA Connection and Item Recovery

    EMA Config Overview

  • Thanks. ChannelSet is already being used. Really good near-instant reconnect when a channel goes down.