1 \addtogroup getting-started
3 \brief Guides through the most significant
4 parts of the Handler's architecture.
6 \details The OnixS::CME::MDH namespace encapsulates the SDK API.
7 The master `OnixS/CME/MDH.h` header file collects all header files
10 Following sections guide through the major steps to be done
11 to succeed with market data processing.
13 \section specifying-license Initializing and Licensing SDK
15 The SDK needs a valid license for successful execution. If
16 the licensing subsystem is not able to find a valid license,
17 it throws an exception at the initialization stage when the
18 OnixS::CME::MDH::initialize is called. Also, a license is
19 verified each time an attempt to start market data processing
20 is done using the OnixS::CME::MDH::Handler::start member.
22 The OnixS::CME::MDH::InitializationSettings class exposes the
23 OnixS::CME::MDH::InitializationSettings::licenseStore member which
24 must be used to instruct the SDK where to look for a valid license.
25 By default, the licensing services look for a license in the current
26 directory of the application. However, by using noted parameter, it
27 is possible to specify another folder anywhere on file system.
29 \note The licensing subsystem looks for a valid license in the
30 specified folder and selects the best one. If multiple licenses
31 are available, it selects the most significant one (for example,
32 a production license is selected instead of a trial one if both
35 The following example demonstrates how to perform one-time SDK initialization:
39 // Parameters for one-time initialization.
40 InitializationSettings settings;
42 // The folder in which the license is stored.
43 settings.licenseStore("license");
45 // Initializes all Handler services explicitly.
46 OnixS::CME::MDH::initialize(settings);
50 \section constructing-handler-instance Configuring and Constructing the Handler
52 The OnixS::CME::MDH::Handler class incapsulates a market data processing
53 machinery. A single instance of the OnixS::CME::MDH::Handler processes
54 market data for a single CME channel.
56 The users must define settings affecting market data processing behavior
57 before constructing an instance of the OnixS::CME::MDH::Handler class.
59 The OnixS::CME::MDH::HandlerSettings class contains all parameters
60 controlling various aspects of market data processing including
61 the behavior of the OnixS::CME::MDH::Handler.
63 In the most cases, default values are set for parameters defining
64 the most likely behavior of the OnixS::CME::MDH::Handler instance.
65 However, some parameters must be set explicitly before constructing
66 an instance of the OnixS::CME::MDH::Handler class.
70 HandlerSettings settings;
72 settings.channel(310);
76 connectivityConfigurationFile("config.xml");
78 Handler handler(settings);
82 See [Handler's Settings](\ref handler-settings) for more
83 information on adjusting behavior of the Handler.
85 \section binding-feedengine-to-handler Binding Feed Engine to the Handler
87 The OnixS::CME::MDH::FeedEngine class encapsulates a layer responsible for
88 receiving market data which is transmitted by the CME MDP. Therefore, to have
89 successful processing of market data, it is necessary to construct an instance
90 of the Feed Engine and to bind it to the previously constructed instance of
91 the OnixS::CME::MDH::Handler class:
95 FeedEngineSettings feSettings;
97 FeedEngine feedEngine(feSettings);
99 handler.bindFeedEngine(feedEngine);
103 See [Feed Engine](\ref feed-engine) for more details on Feed Engine.
105 \note An instance of the OnixS::CME::MDH::Handler does not manage
106 lifetime of a bound OnixS::CME::MDH::FeedEngine instance. Therefore,
107 user responsibility is to keep an instance of the OnixS::CME::MDH::FeedEngine
108 class valid while it is bound to an instance of OnixS::CME::MDH::Handler class.
110 \section binding-logger-to-handler Logging Market Data and Other Events (Optional)
112 The Handler may log market data it processes for further use by
113 replay feature or analysis as well as other important events which
114 may take place during regular market data processing.
116 The OnixS::CME::MDH::Logger abstract class encapsulates the
117 logging subsystem. The SDK provides various implementations
118 of logging for different purposes. File-based logging is
119 satisfactory choise for the most cases.
121 Below is an example of how file based logging can be established:
125 FileLoggerSettings loggerSettings;
127 // Sets filename of log as it was used by older Handlers.
128 loggerSettings.filename(makeLogFilename(310));
130 // Varies which events are to be logged.
131 loggerSettings.severityLevel(LogSeverity::Debug);
133 FileLogger logger(loggerSettings);
135 handler.bindLogger(logger);
139 \note An instance of the OnixS::CME::MDH::Handler does not manage
140 lifetime of a bound OnixS::CME::MDH::Logger instance. Therefore,
141 user responsibility is to keep an instance of the OnixS::CME::MDH::Logger
142 class valid while it is bound to an instance of OnixS::CME::MDH::Handler class.
144 \section registering-listeners-with-handler Subscribing to Market Data Events
146 Once an instance of the OnixS::CME::MDH::Handler is constructed
147 and bound to an instance of the OnixS::CME::MDH::FeedEngine, market
148 data processing can be started. However, it's necessary to subscribe
149 to corresponding events to get the results of market data processing
150 like updated order books.
152 See the [Event Listeners](\ref event-listeners) topic concerning which
153 events are exposed by the Handler and how to subscribe to a particular
156 \section spawning-md-processing Spawning Market Data Processing
158 As soon as an instance of the OnixS::CME::MDH::Handler is configured,
159 bound to a valid instance of the OnixS::CME::MDH::FeedEngine and listeners
160 for events are registered, market data processing can be initiated.
162 Market data processing is initiated by invoking the OnixS::CME::MDH::Handler::start
163 member, which accepts an instance of OnixS::CME::MDH::SessionSettings class defining
164 the behavior of the Handler for the session.
166 For the most common processing scenarios, the SDK exposes ready-to-use
167 presets of session settings: OnixS::CME::MDH::AccurateLateJoinSession(),
168 OnixS::CME::MDH::AccuratePreopeningSession, OnixS::CME::MDH::NaturalRefreshSession,
169 etc. See documentation for noted classes for more details.
173 handler.start(AccurateLateJoinSession());
177 The OnixS::CME::MDH::Handler::stop member must be
178 called to accomplish live market data processing:
186 \note For more and up-to-date information on getting started aspects,
187 see __GettingStarted__ sample from the samples collection available in
188 distributive package.