question

Upvotes
Accepted
1 0 1 2

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


refinitiv-realtimeelektronelektron-sdkema-apirrtelektron-message-api
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.

1 Answer

· Write an Answer
Upvote
Accepted
25.4k 90 13 25

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 512.0 KiB each and 1.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.

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.