I need to subscribe to numerous items using EMA Java API, doing this quickly would impact other connections/clients, what's the best way to reduce the impact? Adding sleep between subscriptions is one solution, is there another way?
Hi @ahmire.kailer, Pacing the subscriptions in the code is the only mechanism - EMA does not provide any other means.
If you need to subscribe to whole bunch of instruments at once, then please look into the Batch subscriptions. Here is an article showing how to use this feature.
Thank you for your answer. Am I right in thinking that a single batch request would have very little impact on other streams/clients even if the batch consists of many instruments (e.g. 200k instruments)?
What does the handle returned by registerClient() correspond to when a batch request is used? How do I get the handles for individual instruments? Can I get them in the same thread instead of the callback/dispatch thread?
I had a look at example370__MarketPrice__Batch, it shows how to registerClient(), I'd like to know how to unregister() individual instruments.
If the batch size is large, it is bound to impact other open streams since the network is getting flooded with new request/responses. This will all depend on the market state and how volatile subscribed instruments are. Once the items are subscribed in the batch, they can still be individually closed. Batch Stream will be closed automatically after server receives a batch request. Consumer application will receive item response on individual streams. To remove subscription for an item, the application needs to get handle of item stream via OmmConsumerEvent,handle() in onRefreshMsg(), and then use the handle in the OmmConsumer.unregister() method.
EMA developer guide which is included with ESDK package has more information on the batch.
The application may implement a subscription throttle in the application level to not send all item request messages to the API in the same time. For example,