For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
2 4 7 9

Item Resubscription

So we open a session for subscription for an item say AAPL.OQ, get some refresh and updates, then close the subscription using CloseMsg with below params:

closeMsg.clear();
encodeIterator.clear();
closeMsg.msgClass(MsgClasses.CLOSE);
closeMsg.containerType(DataTypes.NO_DATA);
closeMsg.flags(CloseMsgFlags.ACK);
byteBuffer.clear();
encodeBuffer.clear();
encodeBuffer.data(byteBuffer);

encodeIterator.setBufferAndRWFVersion(encodeBuffer, Codec.majorVersion(), Codec.minorVersion());

Now within the same session, I want to resubscribe to AAPL.OQ, I see that though my request for subscription is sent to TREP, I don't get any responses (refresh messages) back.

How to resubscribe after unsubscription within the same session

elektronrefinitiv-realtimeelektron-sdktrep
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.

Upvotes
Accepted
76.7k 238 52 72

@pratik.p.mehta

To close a stream, you need to specify the streamID of the closed item.

closeMsg.clear();
closeMsg.msgClass(MsgClasses.CLOSE);
closeMsg.streamId(streamId());
closeMsg.domainType(domainType);
closeMsg.containerType(DataTypes.NO_DATA);

After that, you can send a new request message to subscribe to that item.

You can refer to the com.thomsonreuters.upa.examples.consumer example in the Elektron SDK package regarding closing and requesting items.

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.

Upvotes
25.3k 87 12 25

Hi @pratik.p.mehta

Depending on your use case / requirements - you may want to explore the Pause / Resume functionality available with the Elektron APIs.

As the name suggests, you can pause an event stream and resume it as required - for some scenarios this can be more efficient than close and resubscribe.

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.

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.