How to Run Refinitiv Real-Time SDK C/C++ Warm Standby Examples

Photo by vahid kanani on Unsplash

Prerequisites

1. At least two ADS instances that support a warm standby feature. Those ADS instances must provide an identical service (supported domains, quality of service, etc.). The following configuration must be added to the ADS configuration file to enable a Warm Standby feature on the consumer side.

*ads*supportWarmStandby : True

Enterprise Message API Warm Standby Configurations

The Warm Standby is made available in Enterprise Message API via the following configurations.

EMA C++ 470_MP_WarmStandby Example

The 470_MP_WarmStandby demonstrates the usage of the warm standby feature that creates two connections to an active server and a standby server in EMA, and then switches between these two servers when the service is down or the connection is lost. It uses the programmatic configuration to enable the warm standby feature.

<?xml version=”1.0" encoding=”UTF-8"?><EmaConfig><ConsumerGroup><DefaultConsumer value=”Consumer_8"/><ConsumerList><! — Consumer for warm standby feature →<Consumer><Name value=”Consumer_8"/><WarmStandbyChannelSet value=”WarmStandbyChannel_1"/><Logger value=”Logger_1"/><Dictionary value=”Dictionary_2"/></Consumer></ConsumerList></ConsumerGroup><ChannelGroup><ChannelList><Channel><Name value=”Channel_1"/><ChannelType value=”ChannelType::RSSL_SOCKET”/><CompressionType value=”CompressionType::None”/><GuaranteedOutputBuffers value=”5000"/><Host value=”localhost”/><Port value=”14002"/><ObjectName value=””/></Channel><Channel><Name value=”Channel_2"/><ChannelType value=”ChannelType::RSSL_SOCKET”/><CompressionType value=”CompressionType::None”/><GuaranteedOutputBuffers value=”5000"/><Host value=”localhost”/><Port value=”14003"/><ObjectName value=””/></Channel></ChannelList></ChannelGroup><WarmStandbyServerInfoGroup><WarmStandbyServerInfoList><WarmStandbyServerInfo><Name value=”Server_Info_1"/><Channel value=”Channel_1"/><PerServiceNameSet value=”ELEKTRON_DD”/></WarmStandbyServerInfo><WarmStandbyServerInfo><Name value=”Server_Info_2"/><Channel value=”Channel_2"/><PerServiceNameSet value=”ELEKTRON_DD”/></WarmStandbyServerInfo></WarmStandbyServerInfoList></WarmStandbyServerInfoGroup><WarmStandbyGroup><WarmStandbyList><WarmStandbyChannel><Name value=”WarmStandbyChannel_1"/><StartingActiveServer value=”Server_Info_1"/><StandbyServerSet value=”Server_Info_2"/><WarmStandbyMode value=”WarmStandbyMode::SERVICE_BASED”/></WarmStandbyChannel></WarmStandbyList></WarmStandbyGroup><LoggerGroup><LoggerList><Logger><Name value=”Logger_1"/><LoggerType value=”LoggerType::Stdout”/><LoggerSeverity value=”LoggerSeverity::Success”/></Logger><Logger><Name value=”Logger_2"/><LoggerType value=”LoggerType::File”/><FileName value=”emaLog”/><LoggerSeverity value=”LoggerSeverity::Success”/></Logger></LoggerList></LoggerGroup><DictionaryGroup><DictionaryList><Dictionary><Name value=”Dictionary_1"/><DictionaryType value=”DictionaryType::ChannelDictionary”/></Dictionary><Dictionary><Name value=”Dictionary_2"/><DictionaryType value=”DictionaryType::FileDictionary”/><RdmFieldDictionaryFileName value=”./RDMFieldDictionary”/><EnumTypeDefFileName value=”./enumtype.def”/></Dictionary></DictionaryList></DictionaryGroup></EmaConfig>

Enterprise Transport API Warm Standby Settings

In ETA, the Warm Standby feature is implemented at the Value Add Watchlist layer. It provides the RsslReactorWarmStandbyGroup and RsslReactorWarmStandbyServerInfo data structures to create a Warm Standby group and a Warm Standby server information. Then, the RsslReactorWarmStandbyGroup will be assigned to the RsslReactorConnectOptions instance. The following picture shows the relations of ETA data structures that are used to set a warm standby group.

RsslReactorWarmStandbyGroup reactorWarmStandbyGroup;RsslReactorWarmStandbyServerInfo standbyServerInfo;
RsslReactorConnectOptions reactorConnectOpts;
//Configure an active server in RsslReactorWarmStandbyGroupreactorWarmStandbyGroup.startingActiveServer.reactorConnectInfo.rsslConnectOptions.connectionType = RSSL_CONN_TYPE_SOCKET;
reactorWarmStandbyGroup.startingActiveServer.reactorConnectInfo.rsslConnectOptions.connectionInfo.unified.address = “dataserver1”;
reactorWarmStandbyGroup.startingActiveServer.reactorConnectInfo.rsslConnectOptions.connectionInfo.unified.serviceName = “14002”;
//Configure a standby serverstandbyServerInfo.reactorConnectInfo.rsslConnectOptions.connectionType = RSSL_CONN_TYPE_SOCKET;
standbyServerInfo.reactorConnectInfo.rsslConnectOptions.connectionInfo.unified.address = “dataserver2”;
standbyServerInfo.reactorConnectInfo.rsslConnectOptions.connectionInfo.unified.serviceName = “14002;
//Configure a warm standby groupreactorWarmStandbyGroup.standbyServerCount = 1;
reactorWarmStandbyGroup.standbyServerList = &standbyServerInfo; reactorWarmStandbyGroup.warmStandbyMode = RSSL_RWSB_MODE_SERVICE_BASED; reactorConnectOpts.warmStandbyGroupCount = 1;
reactorConnectOpts.reactorWarmStandbyGroupList = &reactorWarmStandbyGroup

ETA C WatchlistConsumer Example

The purpose of this example is to demonstrate consuming data from an ADS device, OMM Provider application, or Refinitiv Real-Time — Optimized using ValueAdd components. It is a single-threaded client application. It leverages the consumer watchlist feature provided by the RsslReactor to provide recovery and aggregation of items. Since Refinitiv Real-Time C/C++ SDK 2.0.4.L1 (EMA/ETA 3.6.4.L1), this example supports a warm standby feature via the following parameters.

WatchlistConsumer -startingHostName server1 -startingPort 14002 -standbyHostName server2 -standbyPort 14002 -warmStandbyMode service -s ELEKTRON_DD -mp JPY=

Summary

The warm standby feature is now available in the Refinitiv Real-Time C/C++ SDK 2.0.4.L1. It is implemented in the ETA Reactor with watchlist enabled and made available in EMA via configurations. This feature provides a capability for consumers to failover from an active to one or more standby server(s) when the active server fails. Because the standby server is already aware of items subscribed by a consumer, during a failover, APIs don’t need to re-subscribe items to the standby server. Therefore, Warm Standby can reduce overall recovery time and network traffic for item resubscriptions.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store