question

Upvotes
Accepted
25 6 5 11

EMA Batch request with fieldNames in the elementList

In the EMAJavaBatchViewExample provided, for the following code snippet, the fieldIds 22 and 25 are given as input to "array" variable. Is there an option to provide FieldNames instead?

AppClient appClient = new AppClient();

consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("10.67.4.28:14002").username("user"));

ElementList batchView = EmaFactory.createElementList();

OmmArray array = EmaFactory.createOmmArray();

array.fixedWidth(2); array.add(EmaFactory.createOmmArrayEntry().intValue(22)); array.add(EmaFactory.createOmmArrayEntry().intValue(25));

OmmArray arrayI = EmaFactory.createOmmArray();

arrayI.add(EmaFactory.createOmmArrayEntry().ascii("AUD=")); arrayI.add(EmaFactory.createOmmArrayEntry().ascii("JPY=")); batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, arrayI)); batchView.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1)); batchView.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));

consumer.registerClient (EmaFactory.createReqMsg().serviceName("ELEKTRON_EDGE").payload(batchView), appClient);

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

Monitored by @Wasin Waeosri

Hi @sagar.s.

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks

AHS

Upvotes
Accepted
25.3k 87 12 25

Hi @sagar.s

You can find a list of all the FIDs and Field Names in the RDMFieldDictionary file that comes with the ElektronSDK (in the etc folder). The normal usage scenario is that developers identify the FIDs from the above file and use them in their application code.

IF you really do need to search for fieldnames and obtain the FID in your code, then you could implement some code to iterate through the DataDictionary, matching on the field name to obtain the FID.

Please see the following post - which talks about programmatic access to the DataDictionary.

New Data Dictionary interface in EMA C++

Similar functionality also exists in the latest version of EMA Java.

Note that the Field Name is accessed via the acronym() method of the DictionaryEntry.

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.

Upvote
25.3k 87 12 25

Hi @sagar.s

Only FIELD IDs are supported at present for domains that use FieldLists for the Payload

ElementName names can be used for domains that use ElementList for the Payload

If you try changing the view type to 2 e.g.

add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 2) 

for your MarketPrice request, the Item Status code will report Unsupported View Type and return all the Fields (unfiltered):

Item State: Open / Ok / Unsupported view type / 'All is well'

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.

@Umer Nalla


Is there a function call to retrieve field Ids for given field names?

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.