question

Upvotes
Accepted
1 0 0 0

How do we specify multiple hosts in EMA sdk ?

How do we specify multiple hosts (assuming primary, secondary) for a consumer client ?


Below is the function signature from their header

OmmConsumerConfig& host( const EmaString& host = "localhost:14002" );


It can accept “host:port”, however in our current setup of trep/rfa, we provide 2 hosts, i.e. "host1 host2"


Want to know if there is such provision for Consumer with Ema sdk.

ema-apirefinitiv-realtime-sdk
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

@ryusuke.kamimura

OmmConsumerConfig::host() is used to specify a hostname and port.

1659577439559.png

It doesn't support multiple hosts.

To use multiple hosts, you need to specify it in the EMA configuration via the ChannelSet configuration. 1659577569477.png

You can specify this in the EMAConfig.xml. For example:

<ConsumerGroup>
    <ConsumerList>
         <Consumer>
               <Name value="Consumer_1"/>
               <!-- ChannelSet is optional -->
               <ChannelSet value="Channel_1, Channel_2"/>
               <!-- Logger is optional: defaulted to "File + Success" -->
               <Logger value="Logger_1"/>
               <!-- Dictionary is optional: defaulted to "ChannelDictionary" -->
               <Dictionary value="Dictionary_1"/>
        </Consumer>
   </ConsumerList>
</ConsumerGroup>
...

Otherwise, you can use the programmatic configuration feature of EMA, as shown in the 421_MP_ProgrammaticCfg example.


1659577439559.png (81.9 KiB)
1659577569477.png (119.1 KiB)
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.

Hello @ryusuke.kamimura

Another resource that might help you with the EMA failover/reconnect logic is The Mechanics of EMA Connection and Item Recovery article.

Upvote
24.9k 86 10 22

Hi @ryusuke.kamimura

As well as my colleague's answer, you may also find the Channels and ChannelSets section of the following article useful - Enterprise Message API (EMA) - Configuration Overview | Refinitiv Developers


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.