question

Upvotes
Accepted
15 1 1 6

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-sdkrrtema-apijavasubscriptionric
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
52.5k 134 44 63

@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 1 1 6

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.