question

Upvotes
Accepted
22 2 4 5

MRN EMA C++ API sample code with Elektron failover

We have multiple Elektron Edge servers (Primary, Secondary). I have downloaded you EMA API tutorials.

https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-cc/tutorials#ema-consumer-request-decode-machine-readable-news
https://developers.refinitiv.com/content/dam/devportal/api-families/elektron/elektron-sdk-c/downloads/elektron-sdk-tutorials-source-code/ema-tutorials.zip

In the example it only connects to one Elektron server. It is not up to our standard to fail over from (Primary to Secondary) in case connection failed. Would you give us guidance on how we can add code to implement the failover.

Thanks and best regards,

Xiaowei

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apimrn
icon clock
10 |1500

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

Upvotes
Accepted
7.6k 15 6 9

@xlil997

Refering to EMA CPP Developer Guide document section 2.3 Supported Features, EMA supports Connection Failover.

You can specify a list of failover servers via the ChannelSet configuration. If a
consumer's connection attempt fails, EMA attempts to connect to the next channel in
the ChannelSet list.

You can find details about ChannelSet configuration from EMA Configurtion Guide(EMACPP_ConfigGuide.pdf) locates in < EMA Install Path >/Docs.

and below is sample configuration from the document.

<ConsumerGroup>
  <ConsumerList>
	<Consumer>
		<Name value="Consumer_1"/>
			<!-- ChannelSet is optional -->
			<ChannelSet value="Channel_1, Channel_2"/>
			<Logger value="Logger_1"/>
			<Dictionary value="Dictionary_1"/>
	</Consumer>
  </ConsumerList>
</ConsumerGroup>
<ChannelGroup>
  <ChannelList>
	<Channel>
		<Name value="Channel_1"/>
		<ChannelType value="ChannelType::RSSL_SOCKET"/>
		<Host value="localhost"/>
		<Port value="14002"/>
	</Channel>
	<Channel>
		<Name value="Channel_2"/>
		<ChannelType value="ChannelType::RSSL_SOCKET"/>
		<Host value="122.1.1.100"/>
		<Port value="14008"/>
	</Channel>
  </ChannelList>
</ChannelGroup>	

channelset.jpg (53.7 KiB)
icon clock
10 |1500

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

Upvotes
20.3k 73 10 20

Hi @xlil997

The tutorials are designed to help a new developer familiarise themselves with the basics of EMA and therefore intentionally simple and should not be used as the basis for any Production application.

My colleague has responded above regarding ChannelSets - you may also wish to refer to my EMA configuration overview article here which includes some notes on ChannelSets.

icon clock
10 |1500

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

Click below to post an Idea Post Idea