Limitation on amount of requested instruments using EMA

hujunhu
hujunhu Explorer

Hi, I am trying to streaming tick data for 40 instruments in a single program. Once 21 of them has been registered, no more registration can be done.

May I know if there is a limitation of number of instruments?

What is the criterion?

Why there are 2 threads for each registration?

I am using a for loop to do this.

for(int i=0; i<40, i++) {
consumer[i] = EmaFactory.createOmmConsumer(config.host("000.000.0.000:00000").username("ABC"));
OmmConsumerClient eventHandler = this;
consumer[i].registerClient(
EmaFactory.createReqMsg().serviceName("IDN_SELECTFEED").name(int2RicMap.get(key)),
eventHandler);
}

Best Answer

  • Michal Frajt
    Michal Frajt Explorer
    Answer ✓

    Hi @hujunhu,

    please use only one instance of the OMMConsumer for all registerClient calls. An OMMConsumer is like a JDBC connection where you connect once and use it for all database queries. Sure, you can have more OMMConsumers for a client sided load balancing or if you need to connect to more end-points (backbones), but usually one OMMConcumer is what you need.

    Regards,
    Michal

    final OMMConsumer myConsumer = EmaFactory.createOmmConsumer(config.host("000.000.0.000:00000").username("ABC"));

    for(int i=0; i<40, i++) {
    OmmConsumerClient eventHandler = this;
    myConsumer.registerClient(
    EmaFactory.createReqMsg().serviceName("IDN_SELECTFEED").name(int2RicMap.get(key)),
    eventHandler);
    }

Answers