Can I associate Metadata with a Request To Elektron API

I want to subscribe to RIC chains but associate each request in the chain with the first correlation handle returned for the first chain record.

E.g.

long firstChainRecordHandle = ommConsumer.registerClient(requestMessage, ommConsumerClient, "0#LCO:");


Can I attach this data in subsequent requests as metadata when requesting the next chain record and any instruments in the long links? I've had a look at parent handles but they seem to be for a different purpose, that I don't quite understand.


https://docs-developers.refinitiv.com/1583830954828/6066/Docs/refman/emajava/com/thomsonreuters/ema/access/OmmConsumerEvent.html#parentHandle--


Best Answer

  • Hi @john.ervine

    I am not entirely sure what you are after, but I am guessing the following will provide what you want:

    When you call registerClient you can provide a Closure argument e.g.

    long firstChainRecordHandle = ommConsumer.registerClient(requestMessage, ommConsumerClient, "0#LCO:", myClosureValue);

    As you will note from the documentation, the closure value can be any type of your choosing::

    Java:
    registerClient(ReqMsg reqMsg, OmmConsumerClient client, java.lang.Object closure
    C++:
    registerClient (const ReqMsg &reqMsg, OmmConsumerClient &client, void *closure=0)

    You can then access the closure value from the callbacks, e.g. onRefreshMsg, onUpdateMsg etc.

    public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event)
    {
    ...
    Java:
    event.closure()
    C++
    event.getClosure()
    }



Answers

  • This is definitely helpful, I can add any object type as a closure containing the metadata of my choosing. Let me try that.