question

Upvotes
Accepted
1 0 0 0

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


elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
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.

1 Answer

Upvote
Accepted
20.3k 73 10 20

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 closureC++:
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()
}



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.

This is definitely helpful, I can add any object type as a closure containing the metadata of my choosing. Let me try that.
Click below to post an Idea Post Idea