question

Upvotes
Accepted
7 1 2 3

Failed to uninitialize OmmBaseImp(_executor.awaitTermination() timed out)

I have some chain code (using EMA JAVA API with jdk8). After parsing the chain code, there are 30,000 RICS in total. Then I need to subscribe to these 30,000 rics. Since each request can only subscribe to 5,000 rics, I need to do circular subscriptions for these 30,000 rics. For every 5,000 ric processes, my approach is: first register with batch, then get data, and finally call uninitalize () method. In addition, after subscribing, receive data is set for 6 minutes, but in the process of processing, occasionally the following errors will be reported, and some data can not be received. Request help.. Can somebody help?

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apiconnection
ricchain.png (5.1 KiB)
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
23.6k 84 10 22

Hi @chenjihui

One possibility for the error is that you are unintializing the OmmConsumer whilst there are still some events in the queue outstanding. You can raise a Premium Support ticket to get this investigated further - as it may require in depth diagnostics.

However, you should not need to uninitialize OmmConsumer between your batches. You can use the same OmmConsumer to request the next batch and only unintialize when you are ready to terminate the application.

Also, if you use snapshot mode, then the API will close the event stream for each RIC once you received the snapshot - so you don't need to unregisterclient for each of the RICs.

If you want to Snapshot 30,000 RICs, I would personally do this in a paced way without using the EMA Batch functionality e.g. request my first 1000-2000 RICS individually and as I start receiving my Snapshot responses, keep track of the number of snapshots I have received. Once I get back 500 snapshots, I would then request my next 500 RICS and so on. These numbers are just suggestions - you may chose to request a larger or smaller number of RICS initially and in subsequent 'batches'.

If you prefer to use the EMA Batch functionality, you could still use a variation of the above e.g. make your 5000 Batch request, and then once you have received e.g. 1000 Snapshots, request your next 1000 RICs and so on....

NOTE that when counting snapshot responses, you should also allow for StatusMsg responses e.g. for Invalid RICs

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.

We optimized the processing time after receiving market data, and this error no longer occurred.

Upvotes
23.6k 84 10 22

Hi @chenjihui

Can you please provide some additional information so that we can better understand the situation?

Are you getting the above error after you call ommconsumer.uninitialize() or is this before you have called the uninitialize() method? If you are calling unitialize() please explain why you are doing this.

Are you using a single OmmConsumer instance at any one time or multiple?

Are your subscription requests for the RICs snapshot requests (interestAfterRefresh(false)) or streaming request? If you are using streaming request - do you actually need to - as it sounds like you only want snapshot values?

Can you confirm if the problem still occurs if you do not use EMA Batch functionality and just repeatedly call registerClient for each individual RIC - whilst pacing the calls i.e. not calling 5000/30,000 times in a tight loop?

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.Every iteration I recreate ommconsumer,then use it subscribe to 5000 RICS in batches for six minutes, and then uninitialized ommconsumer.This error usually occurs between loops.

2.I should just need the snapshot value. I'll try the interestAfterRefresh method fix it

3.If I only subscribe to 5000 ric runs once in batch mode, I can collect the data completely without error.