When creating and registering a batch request message for multiple RIC's with EMA for Java, is it possible to determine the RIC or some other identifier for each incoming event?
I have run example370_MarketPrice_Batch in EMA Java 1.0.5 package. I found that the UpdateMsg in the callback method contains the name and service name.
public void onUpdateMsg(UpdateMsg updateMsg, OmmConsumerEvent event) { System.out.println("Item Name: " + (updateMsg.hasName() ? updateMsg.name() : "<not set>")); System.out.println("Service Name: " + (updateMsg.hasServiceName() ? updateMsg.serviceName() : "<not set>")); if (DataType.DataTypes.FIELD_LIST == updateMsg.payload().dataType()) decode(updateMsg.payload().fieldList()); System.out.println(); }
The output is:
Incoming Reactor message (Fri Sep 02 17:52:16 ICT 2016):<!-- rwfMajorVer="14" rwfMinorVer="1" --><UPDATE domainType="MARKET_PRICE" streamId="5" containerType="FIELD_LIST" flags="0x90 (HAS_SEQ_NUM|DO_NOT_CONFLATE)" updateType="0" seqNum="13918" dataSize="8"> <dataBody> <fieldList flags="0x08 (HAS_STANDARD_DATA)"> <fieldEntry fieldId="3284" data="0C23"/> </fieldList> </dataBody></UPDATE>Item Name: JPY=Service Name: API_ELEKTRON_EPD_RSSLFid: 3284 Name = EURO_NETCH DataType: Real Value: 0.35
The above output shows the XML tracing of the retrieved update and the output from the example. Although the update message doesn't contain information about the item name and service, EMA can map it to the subscribed item name and and service name.
Chris, There are two mechanisms for identifying the updates from one another. First is the Refresh/Update callback carries the instrument name in its payload. E.g:
if(updateMsg.hasName()) updateMsg.name(); // subscription RIC
Other is using closures - which is any user defined object, passed as a parameter when registering a client. In the callback event this closure object can be retrieved as:
OmmConsumerEvent.closure()
There is another thread on here with some related information you may find useful
Problem retrieving all the market prices for batch request
I'm finding that the update messages do not have a name associated with them. Only the refresh messages do from what I can see. Is this maybe an issue with how I'm creating the request messages? Regarding closures, I'm unclear on how the RIC can be assigned to individual messages.