[EMA Java] How to receive connection level events such as a disconnection?
I am trying to integrate EMA in our proprietary framework, where I need to publish events and alerts should the connection to Reuters fail. I cannot seem to be able to consume such events through the OmmConsumerClient interface.
What would be the best way to receive those? Do I need to manually issue a source directory request message?
When I forcibly close the connection by terminating the VPN, I see a message in the logs but the OmmConsumerClient is not called.
Example:
2018-11-29 09:39:07,157 WARN [pool-2-thread-1] | com.thomsonreuters.ema.access.OmmConsumerImpl | | loggerMsg
ClientName: ChannelCallbackClient
Severity: Warning
Text: Received ChannelDownReconnecting event on channel Channel
RsslReactor Channel is null
Error Id 0
Internal sysError 0
Error Location Reactor.processWorkerEvent
Error text Error - exceeded initialization timeout (5 s)
loggerMsgEnd
Best Answer
-
If you want to monitor connection loss, you can explicitly registerClient for the MMT_LOGIN domain. This way you will receive Status Msg when the connection is lost and RefreshMsg when connection is restored and the application successfully logs back into the server again.
So, for example if I run the example example330 Login_Streaming,which registers for MMT_LOGIN (and IBM.N MarketPrice).
The stream with Item Handle 1 is the Login stream below.
When I disconnect my VPN I get the following:
Received Status. Item Handle: 1 Closure: null
Item Name: umer.nalla
Service Name: <not set>
Item State: Open / Suspect / None / 'channel down'
Received Status. Item Handle: 1 Closure: null
Item Name: <not set>
Service Name: <not set>
Item State: Open / Suspect / None / ''
Received Status. Item Handle: 2 Closure: null
Item Name: IBM.N
Service Name: ELEKTRON_DD
Item State: Open / Suspect / None / 'channel down.'and when I reconnect my VPN I get:
Received Refresh. Item Handle: 1 Closure: null
Item Name: umer.nalla
Service Name: <not set>
Item State: Open / Ok / None / 'Login accepted by host test1-ads.'
Received Status. Item Handle: 1 Closure: null
Item Name: umer.nalla
Service Name: <not set>
Item State: Open / Ok / None / 'channel up'
Received Refresh. Item Handle: 2 Closure: null
Item Name: IBM.N
Service Name: ELEKTRON_DDIf you want to know about individual Service states i.e. if a particular service goes down and then comes back up, then you can register for MMT_DIRECTORY domain events as you mentioned above. This is demonstrated in example331 Directory_Streaming.
Note that if you specify a ServiceName, it will only provide information on that single service. If you want to know about all services, then omit the servicename.consumer.registerClient(reqMsg.domainType(EmaRdm.MMT_DIRECTORY)
.serviceName("ELEKTRON_DD"), appClient);0
Answers
-
Thanks for that, where can I find example 330?
0 -
The examples should be in the EMA Examples subfolder when you install the Elektron Java SDK
e.g. for 330 :
Java\Ema\Examples\src\main\java\com\thomsonreuters\ema\examples\training\consumer\series300\example330__Login__Streaming
If you don't have full SDK please download from Elektron SDK - Java Downloads
0 -
Thanks for the info, I am getting somewhere now.
But, I only receive a notification once for the first failure. I would be interested in receiving failed reconnection attemps such as:
2018-12-05 11:34:45,209 WARN [pool-2-thread-1] | com.thomsonreuters.ema.access.OmmConsumerImpl | | loggerMsg ClientName: ChannelCallbackClient Severity: Warning Text: Received ChannelDownReconnecting event on channel Channel RsslReactor Channel is null Error Id 0 Internal sysError 0 Error Location Reactor.processWorkerEvent Error text Error - exceeded initialization timeout (5 s) loggerMsgEnd
0 -
Hi @andre.malenfant,
The only way I believe you can capture these reconnection attempt messages is to create a Logger handler within your code. Within the SpeedGuide utility, I created a handler class called: StatusLogHandler within the file SpeedGuideConsumer.java which allows you to get the contents of the message coming from logs and peel apart the details. It is used as a status display within Speed Guide display.
1 -
Thanks for taking the time to figure this out. It's unfortunate that we don't receive additional status messages for re-connections. I would I liked to use that as a way to not be trigger happy on the alerts but it seems that I will send alerts on the first failure, as I do not want to rely on parsing a logger output that is prone to change over time.
Thanks again @Umer Nalla and @nick.zincone.1 for your help!
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 370 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛