OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.2
API documentation
Getting Started

Inner Contents

 Setting Up Feed Engine
 
 Replaying Log Files
 

Detailed Description

Eurex T7 Market and Reference Data Interfaces (EMDI, RDI) Handlers C++ library contains 4 handlers which provide access to corresponding Eurex NTA data interfaces:

All handlers' classes are placed into the OnixS::Eurex::MarketData namespace. Header files are collected in the master OnixS/Eurex/MarketData.h header file.

The typical way of using a handler is as follows:

Public reference data, delivered by Eurex RDI, contains the technical configuration, e.g., a multicast address and port combinations for market data interface for all products and instruments. When OnixS::Eurex::MarketData::RdiHandler receives all current reference data it provides the list of the market data interface descriptors (OnixS::Eurex::MarketData::EmdiDescriptors) to create minimal number of OnixS::Eurex::MarketData::EmdiHandler instances for requested products. The same way is used for EOBI handler.

Configuring and Constructing the Handler

All Handler' constructors accept an instance of corresponding handler's settings class which defines values of various parameters for determination Handler's behavior. Role of the most important parameters that used in regular cases are described below.

Primary Settings

Directory for Log Files

By default, all the important aspects of the Handler's activity are logged.Therefore the handler must know where this kind of information can be stored on a local file system. OnixS::Eurex::MarketData::HandlerSettings::logDirectory parameter need be defined for pointing the handlers place where log files to be stored.

Licensing

The handler can not be run without a license file. When the instance fails to find a valid license, it throws an exception at the initialization stage.

OnixS::Eurex::MarketData::HandlerSettings contains OnixS::Eurex::MarketData::HandlerSettings::licenseDirectory member which contains path to directory containing license file(s). If it's value is empty the handler looks for the license file in current directory.

Note
When there is more than one license file in the license directory the most significant one is chosen (for example, a production instead of a trial if both are available).

Example

Following example demonstrates how to set up initial settings for OnixS::Eurex::MarketData::RdiHandler:

RdiHandlerSettings settings;
// This option is used to control verbosity of logger.
settings.logLevel = LogLevel::Debug;
// This option is used to specify extra logger settings.
settings.logSettings = LogSettings::Default;
// Logs will be stored in 'logs' local sub folder.
settings.logDirectory = "logs";
// This option is used to instruct the Handler where to look for a valid license.
settings.licenseDirectory = "../../license";
RdiHandler handler (settings);

Binding Feed Engine to the Handler

Network layer responsible for receiving market data transmitted by Eurex data interfaces is encapsulated into a OnixS::Eurex::MarketData::FeedEngine class. Therefore, to have successful market data processing, it's necessary to construct an instance of the Feed Engine and bind it to the previously constructed instance of a handler class:

FeedEngineSettings feSettings;
FeedEngine feedEngine(feSettings);
handler.bindFeedEngine(feedEngine);

See Feed Engine for more details on Feed Engine.

Note
Any market data handler does not manage the lifetime of the binding OnixS::Eurex::MarketData::FeedEngine instance. Therefore, keeping the instance of OnixS::Eurex::MarketData::FeedEngine valid while it's bound to the instance of OnixS::Eurex::MarketData::Handler is fully user responsibility.

EMDI handler manager

As it was previously mentioned, the reception of the market data interface descriptors (OnixS::Eurex::MarketData::EmdiDescriptors), which required for creation EmdiHandler is a duty of the OnixS::Eurex::MarketData::RdiHandler. OnixS::Eurex::MarketData::EmdiHandlerManager can automate this process.

Example

Following example demonstrates how to use OnixS::Eurex::MarketData::EmdiHandlerManager:

FeedEngineSettings feedEngineSettings;
FeedEngine feedEngine(feedEngineSettings);
//create an instance of the reference data handler
RdiHandlerSettings rdiSettings;
RdiHandler rdiHandler (rdiSettings);
rdiHandler.bindFeedEngine(feedEngine);
rdiHandler.registerErrorListener (&myListener);
rdiHandler.registerWarningListener (&myListener);
rdiHandler.registerReferenceDataListener (&myListener);
clog << "Will start the RDI Handler ..." << endl;
rdiHandler.start();
myListener.waitUntilReferenceDataReceived();
//create instance of EMDI handler manager
EmdiHandlerSettings emdiSettings;
EmdiHandlerManager manager (emdiSettings);
manager.registerDepthListener (&myListener);
//register user's callbacks
manager.registerErrorListener (&myListener);
manager.registerWarningListener (&myListener);
manager.registerProductStateChangeListener (&myListener);
manager.registerMassInstrumentStateChangeListener (&myListener);
manager.registerInstrumentStateChangeListener (&myListener);
manager.registerQuoteRequestListener (&myListener);
manager.registerCrossRequestListener (&myListener);
manager.registerComplexInstrumentUpdateListener (&myListener);
manager.registerOrderBookListener (&myListener);
manager.registerTradeListener (&myListener);
//specify the list of products market data to receive for
MarketSegments productNames;
productNames.insert ("FDAX");
productNames.insert ("FGBL");
productNames.insert ("FGBM");
//start manager
manager.start (&rdiHandler, productNames, feedEngine);
clog << "Please press Enter key to stop the handlers..." << endl;
waitUntilEnterKey ();
clog << "Stopping..." << endl;
rdiHandler.stop (true);
manager.stop();
clog << "Handlers are stopped." << endl;
Note
To obtain full and up-to-date network connectivity configuration settings please refer to 'Network Configuration Guide' provided by Eurex.
For more and up-to-date information on getting started aspects, see GettingStarted sample from the samples collection available in distributive package.