question

Upvotes
Accepted
24 4 0 7

How do I know when the dictionary refresh is complete?

When requesting a dictionary I can't tell when I've received all the messages. Currently I get 4 refresh messages with the field dictionary spread accross them. How can I tell in Elektron that I have no more messages pending? In RFA you can set completion events or check the connection state but I can't find the equivalent in Elektron.

Here's the request I send:

DictionaryClient dictionaryClient = new DictionaryClient();

long fieldHandle = consumer.registerClient(EmaFactory.createReqMsg()
.domainType(EmaRdm.MMT_DICTIONARY)
.name("RWFFld")
.serviceName("REPUB")
.initialImage(true)
.interestAfterRefresh(false) //SNAPSHOT .filter(EmaRdm.DICTIONARY_NORMAL), dictionaryClient);
elektronrefinitiv-realtimeelektron-sdkjavaconsumer
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.

Upvote
Accepted
1.9k 6 9 16

Hello @tbaker,

Elektron-SDK1.1.0.java was released on the last Friday (April 28, 2017).

I've tested it with the same scenario, it seems like the API can give a correct result now.

// Register Items
   ReqMsg reqMsg = EmaFactory.createReqMsg();
   consumer.registerClient(reqMsg.clear().serviceName("myServiceName").name("RWFFld").domainType(DomainTypes.DICTIONARY).filter(7), appClient);
   consumer.registerClient(reqMsg.clear().serviceName("myServiceName").name("RWFEnum").domainType(DomainTypes.DICTIONARY).filter(7), appClient);
   consumer.registerClient(reqMsg.clear().serviceName("myServiceName").name("JPY=").domainType(DomainTypes.MARKET_PRICE), appClient);
   consumer.registerClient(reqMsg.clear().serviceName("myServiceName").name("BB.TO").domainType(DomainTypes.MARKET_BY_PRICE), appClient);

// onRefreshMsg Callback Method
public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event)
{
   System.out.println("refreshMsg.domainType(): " + DomainTypes.toString(refreshMsg.domainType()));
   System.out.println("refreshMsg.name(): " + refreshMsg.name());
   System.out.println("refreshMsg.complete(): " + refreshMsg.complete());
}

Here is the result:

refreshMsg.domainType(): DICTIONARY
refreshMsg.name(): RWFFld
refreshMsg.complete(): true
refreshMsg.domainType(): DICTIONARY
refreshMsg.name(): RWFEnum
refreshMsg.complete(): true
refreshMsg.domainType(): MARKET_PRICE
refreshMsg.name(): JPY=
refreshMsg.complete(): true
refreshMsg.domainType(): MARKET_BY_PRICE
refreshMsg.name(): BB.TO
refreshMsg.complete(): true

To download the latest version of EMA Java, please access this link.

Hope this helps!

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.

Hi Nipat,

I've tested with 1.1.0 and the completion events do work now for dictionary requests. Thanks for helping!

I found a different bug in 1.1.0 which I raised on github (https://github.com/thomsonreuters/Elektron-SDK/issues/26), so we can't move to the fix yet. We have a workaround that we can use until the next Elektron SDK is released.

Upvotes
9.7k 49 38 60

Hi @tbaker

You can determine if a refresh message is complete by using the complete() method on the refreshMsg object when receiving your response(s). Refer to the Multi-Part messages section within the EMA Consumer - Requesting, Parsing and decoding level 2 data tutorial as a guide.

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.9k 6 9 16

Hi @tbaker,

According to the reference manual in the Ema package, the following subclasses of Msg provide a complete() method for checking whether the current message object is a final part of all multi-parts or not.

RefreshMsg - a complete() returns true if this is the last part of the multi part refresh message. 

GenericMsg - a complete() returns true if this is a one part generic message or the final part of the multi part generic message. 

PostMsg - a complete() returns true if this is the last part of the multi part post message. 

Note that there are only three message types; Refresh, Generic, and Post that support message fragmentation. Therefore, message types other than above don't provide the complete() method.

Hope this helps.

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.

Thanks for the response. I am processing the RefreshMsg but complete() remains false. I end up getting 5 messages if I don't set the service name. All messages have the following Complete and State values:

Complete: false, state: Open / Ok / None / ''

Perhaps the dictionary messages aren't multipart but are just separate dictionary sections. Multipart is also set to false and there are no part numbers.

Hello @tbaker,

I've also experienced the same issue when the Dictionary domain involved with the subscription. Therefore, I'll escalate this issue to the Development team.

tbaker avatar image tbaker Nipat Kunvutipongsak

Ok. thanks for raising. Is there any visibility on the issues raised with the development team? There's not a lot of activity on the github page and I don't know if there is a separate ticket tracking available on thomsonreuters.

Show more comments
Click below to post an Idea Post Idea