Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by andre.malenfant · Dec 05, 2018 at 09:00 AM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijavaconnection

[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

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

6 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Dec 05, 2018 at 10:18 AM

Hi @andre.malenfant

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_DD

If 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);
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by andre.malenfant · Dec 05, 2018 at 10:41 AM

Thanks for that, where can I find example 330?

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by umer.nalla · Dec 05, 2018 at 10:46 AM

Hi @andre.malenfant

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

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by andre.malenfant · Dec 05, 2018 at 11:36 AM

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

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Answer by nick.zincone · Dec 05, 2018 at 12:28 PM

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.


ahs.png (79.0 KiB)
Comment
umer.nalla

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Answer by andre.malenfant · Dec 05, 2018 at 12:43 PM

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!

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
12 People are following this question.

Related Questions

(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

EMAJ: How to keep long connection to server in OMMConsumer?

Is there a way to get holiday calendar for markets (instrumen wise or general) using Java API?

NullPointerException when printing FieldList content from update message to screen

Monitor status of TREP connection

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges