[C#] How to properly handle client side crashes and restarts

hermann.trampenau
edited January 9 in EMA

Hi!

I'm using the RTSDK (https://github.com/Refinitiv/Real-Time-SDK/tree/master/CSharp/Ema) to connect to an OMM Provider application and listen to updates on about 30k instruments.

Suppose I create my consumer class, use it to register interest for a set of instruments, and receive updates. I'm wondering what happens if my client application is not able to gracefully shut down, e.g it crashes. In such events I would be unable to call consumer.Uninitialize().

  1. What happens to the registrations?
  2. Is it possible to recreate the consumer and have it reuse the same registrations? If so, how?
  3. Am I as a consumer able to programmatically see what items my consumer class is registered to?

What's the recommended way of dealing with situations like this?

Thanks in advance! 😊

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @hermann.trampenau

    Thank you for reaching out to us.

    1. What happens to the registrations?
      If the application crashes, the application and connection will be closed. Therefore, all subscriptions or registrations will be closed too.
    2. Is it possible to recreate the consumer and have it reuse the same registrations? If so, how?
      If the application crashes, you need to close the application, and then restart the application. After that, the application can create new subscriptions or registrations.
    3. Am I as a consumer able to programmatically see what items my consumer class is registered to?
      No, the application can't access the watchlist in the API.

    The application can maintain its own watchlist and regularly save it into a local file. If the application crashes, the new application can read that file and send new subscriptions according to the items in that file.