How do I know when the dictionary refresh is complete?

tbaker
tbaker Explorer

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);

Best Answer

  • Nipat Kunvutipongsak
    Answer ✓

    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!

Answers