(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

Hello,

I just have a quick question regarding interestAfterRefresh. Our application at times may be registering many RICs with elektron at once, and it could potentially hit our elektron license cap. By using:

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

Does this remove our need to unregister RICs manually? Also documentation states that a response may come in the form of one or more messages, if it does unregister automatically, can we assume it will be after all messages have been sent?

Thanks!

Best Answer

  • umer.nalla
    Answer ✓

    Hi @andrew.richardson

    InterestAfterRefresh(false) specifies that you want to make a Snapshot i.e non-streaming request.

    So, if the instrument you request is a valid one (and you are permissioned for it), you should get a RefreshMsg for that instrument and the API will automatically unregister and close the stream for that instrument - you will not receive any Updates.
    If the server is not able to supply the RIC - e.g. it is invalid or you are not permissioned for it - then you will get a StatusMsg indicating this and the stream will be closed also.

    If you want streaming data i.e. a Refresh, followed by updates then you need to set InterestAfterRefresh(True) - which is the default mode - and so does not need to be explicitly specified.

    A MarketPrice request (the default) will provide all data in a single RefreshMsg.

    For other domains such as MarketByPrice, you can expect to receive Multiple Refresh - with the final one having the completion flag set.

Answers