question

Upvotes
Accepted
1 1 0 2

Monitor status of TREP connection

We are using this lib:

Elektron-SDK1.1.1.linux.rrg/Ema/

WE need to monitor the status of the connection as it is working fine in UAT, but in PROD it seems to loose connectivity and we have no information from the lib why this is the case.

How can we monitor this?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apiconnection
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.

Upvotes
Accepted
21.8k 57 14 21

@cees.beekhuis, Your EMA application should receive the status messages when the connection to ADS is lost. You can also enable various logging options to capture message logs in the EMA api. Refer to configuration guide within development guides.

The TREP/ADS has a monitoring console and logs, which should outline the reason for dropped connection. Most commonly, it is the slow consumer, i.e. a consumer which is not processing messages fast enough, causing buffer overruns.

Hope this helps.

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.

Upvotes
1 1 0 2

screenshot-of-ema-guides.pngHi Gurpreet,

Thank you for your response! What is the exact name of the development guide and what page number can I find the information for monitoring the status of a connection?

I clicked on your link and it shows me all the guides for EMA, but non of the guides is called 'configuration guide':


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.

Upvotes
21.8k 57 14 21

If you expand the section: Development and click on "Message API - C++ Development Guides", there will be a set of books, and one such book is called "EMA C++ Configuration Guide". The config guide will allow you to turn on the API message logging.

Realtime notifications on the state of connectivity to server will still happen through the API. See the example 333__Login__Streaming__DomainRep in the EMA examples which show how login stream can be used to monitor the state of connection.

From Readme:

The 333__Login__Streaming__DomainRepresentation showcases usage of login stream in OMM Consumer.
It demonstrates opening of login stream as well as its processing. Having
a login stream open is useful for consumer applications willing to do
Off Stream Posting and or knowing the state of its connectivity to 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.

Upvotes
1 1 0 2

Thanks! I will take a look at this.

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.

Hi Gurpreet,

I added the code from the example. This now returns a text string with below format. However, how do you expect me to inspect that the connection is okay as this is a human readable string, but not a simple status.

I post string below as it exceeds the 600 characters you seem to have to type a message on this platform.


AllowSuspectData : Supported ApplicationId : 256 ApplicationName : <secret> Position : <ip>/net
ProvidePermissionExpressions : NotSupported ProvidePermissionProfile : NotSupported
SingleOpen : Supported SupportBatchRequests : RequestSupported SupportOMMPost : Supported
SupportOptimizedPauseResume : NotSupported SupportViewRequests : NotSupported
SupportEnhancedSymbolList : DataStreamsSupported UserName : <secret> UserNameType : 1
State : StreamState: 1 DataState: 1 StatusCode: 0 StatusText: Refresh Completed

Upvotes
21.8k 57 14 21

The string is for logging purposes. Refer to the ema.access.StatusMsg.state() which returns OMMState which has enumerations for Data, Stream and Status state.

This article provides insight into the item recovery and failover process, with an explanation of state messages.

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.

Upvotes
48 8 17 19

@Gurpreet. Hi, I read your previous post but failed to receive callback message. My application connects to two nginx proxies which either redirect traffic to one trep server. First I shutdown proxy 1, and see such message via stdout

then sdk tried the second proxy and print connect succ message:

Then I shutdown the second proxy, receving such stdout message:

loggerMsg
    TimeStamp: 10:15:55.190
    ClientName: ChannelCallbackClient
    Severity: Warning
    Text:    Received ChannelDownReconnecting event on channel Channel_2
        Instance Name Consumer_2_1
        RsslReactor 0x0x1c5bc10
        RsslChannel 0x0x1c5bc10
        Error Id -1
        Internal sysError 11
        Error Location /opt/lxy/setup/Elektron-SDK1.2.1.linux.rrg/Cpp-C/Eta/Impl/Reactor/rsslReactor.c:3144
        Error Text </opt/lxy/setup/Elektron-SDK1.2.1.linux.rrg/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:608> Error:1002 ipcRead() failure. Connection reset by peer
loggerMsgEnd


loggerMsg
    TimeStamp: 10:15:55.190
    ClientName: LoginCallbackClient
    Severity: Warning
    Text:    RDMLogin stream state was changed to suspect with status message
        username user4
        usernameType 1
        position 172.17.0.3/net
        appId 256
        applicationName ADS
        instanceId <not set>
        singleOpen 1
        allowSuspect 1
        optimizedPauseResume 0
        permissionExpressions 1
        permissionProfile 0
        supportBatchRequest 1
        supportEnhancedSymbolList 1
        supportPost 1
        supportViewRequest 1
        role 0
        State: Open / Suspect / None / 'Channel is down.'
loggerMsgEnd


loggerMsg
    TimeStamp: 10:15:56.211
    ClientName: ChannelCallbackClient
    Severity: Warning
    Text:    Received ChannelDownReconnecting event on channel Channel_1
        Instance Name Consumer_2_1
        RsslReactor 0x0x1c5bc10
        RsslChannel 0x0x1c5bc10Å
        Error Id -1
        Internal sysError 107
        Error Location /opt/lxy/setup/Elektron-SDK1.2.1.linux.rrg/Cpp-C/Eta/Impl/Reactor/rsslReactorWorker.c:676
        Error Text </opt/lxy/setup/Elektron-SDK1.2.1.linux.rrg/Cpp-C/Eta/Impl/Transport/rsslSocketTransportImpl.c:5771> Error: 1002 ipcConnecting() client connect() failed.  System errno: (107)
loggerMsgEnd

The ipcConnecting() failure message continues until I start either of two proxies. But seen from my log, I found onStatusMsg() is not called, as I will print the message there. So my question is:

1) How can onStatusMsg() called back when connection to proxy/trep lost ?

2) Can I figure out which channel connection lost ? As my application connects to two proxies, if only one proxy lost connection, the app is still ok. But if two channels lost connection, I have to take my own action.

3) How to check if the callback statusMsg indicates connection lost or connection restablished succ?

Many thanks, expecting your reply.


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.