Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by parminder.grewal · Feb 16, 2017 at 02:12 PM · rfa javaevent handling

How to handle unsupported events

I am new to using the Java based RFA / OMM api (we currently rely on the jsfc apis)

Looking through the examples on how to handle ItemSubscriptions, I found an interesting piece of code

if (event.getType() != Event.OMM_ITEM_EVENT)

{

System.out.println("ERROR: " + _className + " Received an unsupported Event type."); consumerComponent.cleanup();

return;

}

if I understand this correctly , if an unsupported event type is received, we just shut down the consumer which could affect real time streaming of data. Is this the recommended handling of this kind of event or could we just ignore the event and go on processing next event

My concern is that we shut down consumers altogether, which is unacceptable. We could try restarting them, but if we continuously get the same condition, we could end up in a loop of starting and shutting consumers.

Has anyone encountered this issue before ? Any suggestions are welcome

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.

3 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Nipat Kunvutipongsak · Feb 16, 2017 at 11:10 PM

Hello @parminder.grewal,

In RFA Java (as of version 8.0.1.X), there are various event types as follows:

Event Types	(Constant Value)
---------------------------------
AUTHORIZATION_EVENT	(401)
COMPLETION_EVENT	(2)
CONNECTION_EVENT	(113)
OMM_ACTIVE_CLIENT_SESSION_PUB_EVENT	(125)
OMM_CMD_ERROR_EVENT	(122)
OMM_CONNECTION_EVENT	(129)
OMM_CONNECTION_STATS_EVENT	(130)
OMM_INACTIVE_CLIENT_SESSION_PUB_EVENT	(126)
OMM_ITEM_EVENT	(121)
OMM_LISTENER_EVENT	(124)
OMM_SOLICITED_ITEM_EVENT	(123)
PUB_ERROR_EVENT	(106)
TIMER_EVENT	(3)
UNDEFINED_EVENT	(0)

For an OMMConsumer type of application, you can receive a designate Event Type from registering a corresponding Interest Specifications (IntSpec).

OMMConsumer.registerClient(EventQueue
aQueue, InterestSpec anInterest, Client aClient, java.lang.Object aClosure);

There are four types of IntSpecs that you can put as the argument of OMMConsumer Event Source as follows:

OMMItemIntSpec -> OMMItemEvent

OMMErrorIntSpec -> OMMCmdErrorEvent

OMMConnectionIntSpec -> OMMConnectionEvent

OMMConnectionStatsIntSpec -> OMMConnectionStatsEvent

Furthermore, a COMPLETION_EVENT is a special event of common package. You can switch to receive or not receive this event from this method

Session.createEventSource(int
eventSourceType, java.lang.String name, boolean wCompEvents);

In summary, it is possible that the application can receive more Event Types other than just OMM_ITEM_EVENT.

So, you may need to check how many interest specification(s) that the application has registered (including the COMPLETION_EVENT case). Then, you need to adjust and relax your current logic that checks the Event Types to correspond with the registered interest specification(s).

Alternatively, you may try to debug the incoming event that goes through your logic, check its code (as mentioned above) to identify the Event Type. If you consider it as the unwanted event, you have to review your source code where the application registers surplus interest specification(s). If so, just remove it, restart the application again. The unwanted event(s) should no longer appear anymore.

Hope this helps!

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 Pimchaya.Wongrukun · Feb 16, 2017 at 10:53 PM

Hello @parminder.grewal

The example application just demonstrate how to use RFA to consume data.It should be used as a start point to develop an application. In processEvent(..) method which the application processes events including data, what application should do in the method depends on your requirements and it is not necessary to do the same as the example application does. For example, if you would like to continue receiving data even the application receives unsupported event type events, your application can ignore these events instead of shutdown application which the example application does.

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 Gurpreet · Feb 24, 2017 at 09:23 AM

If you are looking to rewrite an application in any aspect, please consider use of Elektron Message API. It is strategic and considerably easy to use. EMA

Comment

People who like this

0 Show 1 · 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
parminder.grewal · Feb 27, 2017 at 04:43 PM 0
Share

I did look at the EMA api , however while it is more user friendly, it provides lesser visibility. for instance , how do I see the sizes of queues or the age of a message, stuff like this wasnt very clear from the documents or examples.

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 >
8 People are following this question.

Related Questions

RFA versions

How to know when my SSL consumer application is disconnected from the server?

NIP with 2 sessions

Under OMM model, does MarketDataItemEvent can be triggered?

Multi thread support on RFA API

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges