Using one consumer-client for two RICs?

Hi,

We are currently in the test phase of consuming data in the News Text Analytics domain.

And we consume two contents, MRN_STORY and MRN_TRNA.

Currently we have two services receiving each content separately and then joining them afterwards.

1

consumer.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_NEWS_TEXT_ANALYTICS).serviceName("ELEKTRON_DD").name("MRN_STORY"), eventHandler);

2

consumer.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_NEWS_TEXT_ANALYTICS).serviceName("ELEKTRON_DD").name("MRN_TRNA"), eventHandler);

Is there a possibility to consume both together in one consumer-client, which makes joining easier?

Best Answer

  • Hi @martin.mitry,

    Can you elaborate what "one consumer-client" means? In the above code segment, you are opening 2 items which will both be consumed within the same eventHandler. You are requesting from the same consumer.

Answers

  • Hi Nick,

    actually we have two different classes each having one of above clients.
    Very strange, that I actually didn't try to register two clients, but it seems from your answer that this is possible. I will just try now :-)
    Thx
    Martin

  • Thank You @nick.zincone.1 for pointing out that it is possible that multiple clients can be registered to the same eventHandler can handle multiple clients

    OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();
    consumer = EmaFactory.createOmmConsumer(config.host(C_HOST + ":" + C_PORT).username(C_USERNAME));
    OmmConsumerClient eventHandler = this;

    // register clients
    consumer.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_NEWS_TEXT_ANALYTICS).serviceName("ELEKTRON_DD").name("MRN_STORY"), eventHandler);
    consumer.registerClient(EmaFactory.createReqMsg().domainType(EmaRdm.MMT_NEWS_TEXT_ANALYTICS).serviceName("ELEKTRON_DD").name("MRN_TRNA"), eventHandler);