3 1 0 3

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();



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

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.

1.9k 7 9 16

Hello @parminder.grewal,

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

Event Types	(Constant Value)

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

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

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!

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.

9.6k 10 7 7

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.

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.

17.6k 48 13 19

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

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.

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.