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
Best Answer
-
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!
0
Answers
-
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.0 -
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.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 250 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛