question

Upvotes
Accepted
36 1 3 6

Using batch request message with EMA

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?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
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'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.

Upvotes
Accepted
79.1k 250 52 74
@chris.garvin

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_RSSL
Fid: 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.

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.

Upvotes
22.1k 59 14 21

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

Upvotes
25.3k 87 12 25

There is another thread on here with some related information you may find useful

Problem retrieving all the market prices for batch request

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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