question

Upvotes
Accepted
3 0 1 2

Are there any unsubscribe RIC API and snapshot RIC API requests that we can use?

Greetings,

As per title. There are 2 queries as per below:-

1. We would like to unsubscribe a RIC data when our application already requested it for a certain period, say requesting RIC 0#Z74.SI at 8am, and then unsubscribe at 9am, to prevent data keeps on flowing to our application. Is that possible?

2. Is there any snapshot RIC API request that we can use to obtain all stocks data (Singapore and Hong Kong exchanges specifically) at a specific time?

Thanks in advance for your assistance.

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

Upvotes
Accepted
20.3k 73 10 20

Hi @nkssupreme

You have posted this question in the RFA section - but I understand you are interested in all APIs that may offer this functionality?

All of our streaming APIS - RFA, EMA, ETA and Websocket allow you to unsubscribe an instrument as and when required.

You can close an individual item by calling the unregisterClient(RFA) or unregister(EMA) method with the handle of the item you wish to close - this requires to keep hold of the handle that is returned when you first call registerClient.

For Websocket you would send a Close request using the StreamID of the instrument - as detailed in the tutorials.

You can also unregisterclient on the Login handle - this will close all active instruments - but this will also log you out and therefore best used during a shutdown cleanup scenario only.

In terms of snapshot, all the above APIs also allow making snapshot request - where the API closes the item for you once the initial response has been received. This requires setting the relevant flag in the iniitial subscription request e.g. for EMA Java

consumer.registerClient(reqMsg.serviceName("DIRECT_FEED").name("IBM.N")
.interestAfterRefresh(false), appClient);

where in interestAfterRefresh(false) indicates you do not wish to receive updates after the intial refresh.

Or e.g. for RFA Java:

_ommMsg.setIndicationFlags(OMMMsg.Indication.NONSTREAMING 
| OMMMsg.Indication.REFRESH);

Where the NONSTREAMING indication tells the server you only want the intial refresh and no streaming updates thereafter.

I have provided Java snippets above - the techniques for C++/.NET versions of the API are very similar and more details can be found in the relevand documentation for each API - API Catalog

For Websocket you also set "Streaming":false in the request - as described in the tutorials linked above.

If you are writing a new application - then I would strongly recommend you use ElektronSDK(EMA/ETA) rather RFA. Elektron SDK are the newer easier to use strategic APIs, whereas RFA is feature complete/maintenance mode only.


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.

Click below to post an Idea Post Idea