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 Ethan Wong · Oct 20, 2016 at 07:06 AM · rfajavaRFAJdecode

What is the best way to decode the OMMMsgs received (e.g. to get prices) when subscribing to a RIC using RFA?

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.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by susana.chang · Oct 20, 2016 at 03:06 PM

Hi @Ethan Wong

Are you asking about decoding Market Price (for trades, indicative quotes) response message payloads?

If so, here's the description of the Market Price response message payload.

Here's a tutorial on Retrieving Level 1 MARKET PRICE Data

Here's an example:

OMMItemEvent ie = (OMMItemEvent)event;
OMMMsg respMsg = ie.getMsg();

if (respMsg.getDataType() != OMMTypes.NO_DATA) {
	if (respMsg.getPayload().getType() == OMMTypes.FIELD_LIST) {	        	
		OMMFieldList fl = (OMMFieldList) respMsg.getPayload();
		
		 for (Iterator iter = ((OMMIterable)fl).iterator(); iter.hasNext();) {
			 OMMEntry entry = (OMMEntry)iter.next();
			 
			 if (entry.getType() == OMMTypes.FIELD_ENTRY) {
				 OMMFieldEntry fe = (OMMFieldEntry)entry;	             
				 System.out.print("FID="+fe.getFieldId() );	                	 
				 if (CURRENT_DICTIONARY != null)  {
					 FidDef fiddef = CURRENT_DICTIONARY.getFidDef(fe.getFieldId());
					 if (fiddef != null) {	    
						 System.out.print(" FieldName="+fiddef.getName() +" FieldValue=");
						 OMMData data = null;
						 if (fe.getDataType() == OMMTypes.UNKNOWN)
							 data = fe.getData(fiddef.getOMMType());
						 else
							 // defined data already has type
							 data = fe.getData();
						 
						 if (data.getType() == OMMTypes.ENUM) {
							 System.out.print(CURRENT_DICTIONARY.expandedValueFor(fiddef.getFieldId(),
																		  ((OMMEnum)data).getValue()));
							 System.out.println(" (" + data + ")");
						 }  else
							 System.out.println(data); 
					 } else {
						 System.out.println(" - Not defined in dictionary");
					 }
				 } // END - if (CURRENT_DICTIONARY != null)
			 }    // FIELD_ENTRY            
		 } // END-FOR	        	
	} // END - if FIELD_LIST
}

Comment
nick.zincone.1

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.

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

Related Questions

Subscribing to RIC multiple times

How to find the error setting.

Reentrant Decode OMMexception

Determining Fx Rates

Can we set up an RFA Session without using the Config Editor?

  • 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