question

Upvotes
Accepted
15 2 5 12

How to subscribe to a list of RICs using Refinitiv Java EMA API ?

Hi,

The below sample code snippet at the github shows how to subscribe for one RIC for updates.

consumer.registerClient(EmaFactory.createReqMsg().serviceName("IDN_RDF").name("JPY="), appClient);

I'm looking for sample code to start subscription for more than one RIC (List of RICs).

Any help or pointers appreciated.

Thanks,

Mani


elektronrefinitiv-realtimeelektron-sdkema-apirrtjavasubscriptionric
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
78.8k 250 52 74

@Mani.A

You can refer to the example 370 MarketPrice Batch that demonstrates basic usage of the EMA library while opening multiple item stream via a single request (a.k.a., batch request).

The code looks like this:

            ElementList batch = EmaFactory.createElementList();
            OmmArray array = EmaFactory.createOmmArray();
            
            array.add(EmaFactory.createOmmArrayEntry().ascii("TRI.N"));
            array.add(EmaFactory.createOmmArrayEntry().ascii("IBM.N"));


            batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));
            
            consumer.registerClient(EmaFactory.createReqMsg().serviceName("IDN_RDF").payload(batch), appClient);
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
15 2 5 12

Awesome. Thank you.

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.