question

Upvotes
Accepted
1 0 0 4

We are building Level2 MarketByPrice data feed using RFA API and got Invalid InterestSpec type received

We tried to run the Market By Price test and got Exception : Invalid InterestSpec type received: OMM_ITEM_INTEREST_SPEC "125". Following is what we set in the code.

OMMItemIntSpec ommItemIntSpec = new OMMItemIntSpec();

ommmsg.setMsgType(OMMMsg.MsgType.REQUEST);

ommmsg.setMsgModelType(capability);

ommmsg.setPriority((byte)1, 1);

String itemName = client.getRfaSubKey();

ommmsg.setIndicationFlags(OMMMsg.Indication.REFRESH);

ommmsg.setAttribInfo(getServiceName(), itemName, RDMInstrument.NameType.RIC);

ommItemIntSpec.setMsg(ommmsg);

Handle itemHandle = marketDataSubscriber.registerClient(eventQueue, ommItemIntSpec, client, null);

treprfarfa-api
icon clock
10 |1500

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

Upvotes
Accepted
11.3k 25 8 13

Hello @anil.kalra,

Could you please confirm the type of marketDataSubscriber used in the following code?

Handle itemHandle = marketDataSubscriber.registerClient(eventQueue, ommItemIntSpec, client, null);

The OMMItemIntSpec needs to be used by the OMMConsumer to register for Market By Price item request. It will throw the following exception if you register OMMItemIntSpec with MarketDataSubscriber Event Source.

Exception in thread "main" java.lang.IllegalArgumentException: Invalid InterestSpec type received: OMM_ITEM_INTEREST_SPEC "125"
	at com.reuters.rfa.internal.session.md.MarketDataSubscriberImpl.registerClient(Unknown Source)

You can find example code in this tutorial.

icon clock
10 |1500

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

Upvotes
9.5k 10 5 7

Hello @anil.kalra

The application gets the exception because you set 125 which is one value of com.reuters.rfa.common.InterestSpec constant at ommmsg.setMsgModelType(capability).

setMsgModelType(..) method requires the message model type defined in com.reuters.rfa.rdm.RDMMsgTypes constant not com.reuters.rfa.common.InterestSpec constant. The RDMMsgTypes is shown below:

For the complete list, please refer to [RFAJ package]/Docs/refman/rfajava/constant-values.html

To request MarketByPrice, you need to set com.reuters.rfa.rdm.RDMMsgTypes.MARKET_BY_PRICE or 8 shown in the table above in setMsgModelType(..) method. The example snipped source code:

short capability = com.reuters.rfa.rdm.RDMMsgTypes.MARKET_BY_PRICE; 
… 
ommmsg.setMsgModelType(capability); 

I suggest you look into StarterConsumer application located in [RFAJ package]\Examples\com\reuters\rfa\example\omm\cons . The application demonstrates how to subscribe to level1 and level2 data.

Hope this help.


rdmmsgtypes.png (21.1 KiB)
icon clock
10 |1500

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

Hello @Pimchaya.Wongrukun

I did set the MsgModelType as RDM constants. Sorry I missed to post the following two lines. Also I did look at the RFA tutorial 9 for Level2.

short capability = RDMMsgTypes.MARKET_BY_PRICE;

if(subKey.getDepth() == Depth.MarketMaker) {

capability = RDMMsgTypes.MARKET_MAKER;

}

...........

ommmsg.setMsgModelType(capability);

Thanks.

Upvotes
1 0 0 4

Hello @Pimchaya.Wongrukun

I did set the MsgModelType as RDM constants. Sorry I missed to post the following two lines. Also I did look at the RFA tutorial 9 for Level2.

short capability = RDMMsgTypes.MARKET_BY_PRICE;

if(subKey.getDepth() == Depth.MarketMaker) {

capability = RDMMsgTypes.MARKET_MAKER;

}

...........

ommmsg.setMsgModelType(capability);

Thanks.

icon clock
10 |1500

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

Upvotes
9.5k 10 5 7

Hello @anil.kalra

In case the problem still occurs:

I modify tutorial 9 to use ommmsg.setMsgModelType((short)125). When I run with RFA8.1.0.E2. I did not receive the error as your application got but I got the following status message instead:

MESSAGE
	Msg Type: MsgType.STATUS_RESP
	Msg Model Type: Unknown Msg Model Type: 125
	Indication Flags: 
	Hint Flags: HAS_ATTRIB_INFO | HAS_STATE
	State: OPEN, SUSPECT, NONE,  "No connection or service is currently up that supports this request."
	AttribInfo
		ServiceName: API_ELEKTRON_EPD_RSSL
		Name: BBH.ITC
		NameType: 1
	Payload: None

Have you tried your application with the latest RFA version(8.1.0.E2)?

If the problem still occurs with RFA version(8.1.0.E2) or the application receives a status message like above, you should review your source code to make sure that MARKET_BY_PRICE is set in the last setMsgModelType(..) before calling registerClient(..) method.

icon clock
10 |1500

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

Upvotes
1 0 0 4

Hello veerapath.rungruengrayubkul, Pimchaya.Wongrukun

Thanks for your reply and sorry for the late response. I got the level 2 working using RFA OMM message.

I have another question regarding RFA OMMMap. We want to do the parsing of different handles(Ric symbols) in parallel so we want to pass the RFA OMM payload to a different thread and not parse it in the consumer thread. Is it safe to pass the payload to different processing thread.

I know in EMA is it not recommended to do so because the field entries and field lists are reused.

Thanks

Anil Kalra

icon clock
10 |1500

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

Hello @anil.kalra

Please post your new questions as a separate question, not as an answer. When the answer of this post is accepted, marked as "correct", the community tends to only look at the accepted answer and may miss your new questions on the same topic. Posting the new questions on a separate page allows everyone can see the questions and can post answers to help you.

Click below to post an Idea Post Idea