1 \addtogroup migration-guide
3 \brief Covers aspects on migrating from previous releases.
5 Although given release is based on the same processing core as a previous major
6 version release, a lot of aspects have been principally redesigned and improved.
7 Given section covers major differences for painless migration from previous releases.
9 \section migrate-listener-consolidation Consolidated Listeners
11 In previous generations of SDK, listeners were designed to cover smallest
12 aspects of market data processingand thus API contained bunch of listeners
13 to be used to get market-related events handled in a regular application.
14 For example, there was a `OnixS::CME::MDP3::SecurityDefinitionListener` whose
15 members were involved once instrument definition was received and updated.
16 For each type of book there was corresponding listener exposing books after
17 updates. Atomic book changes could be accessed through another set of listeners.
19 To reduce overhead caused by necessity of using wide range of listeners and
20 to bring more clarity, most of listeners have been consolidated.
22 Primary principle was to consolidated Handler, Market Data (message) and Security
23 related events. Table below depicts basic correspondence between old and new listeners.
27 <th>Old Listeners</th>
33 `OnixS::CME::MDP3::HandlerStateChangeListener`
34 `OnixS::CME::MDP3::WarningListener`
35 `OnixS::CME::MDP3::ErrorListener`
38 `OnixS::CME::MDH::HandlerListener`
41 State change and issue (warning, error) events were merged into the new
42 listener containing callbacks which are invoked to notify users on various
43 aspects of market data processing by Handler.
48 `OnixS::CME::MDP3::MessageProcessingListener`
49 `OnixS::CME::MDP3::EventMessageListener`
50 `OnixS::CME::MDP3::EventListener`
53 `OnixS::CME::MDH::MarketDataListener`
56 OnixS::CME::MDH::MarketDataListener represents adoptation of
57 `OnixS::CME::MDP3::MessageProcessingListener` to the new messaging
58 subsystem. Since unified FIX message container was substituted with
59 typified SBE messages as they are defined in CME specification,
60 listener was enhanced with overloads for each type of new message.
62 Also, new members defining bounds of packet processing have been
63 added. For this reason old `EventMessageListener` and `EventListener`
64 listeners were removed from API as the improved market data listener
65 allows to implement given event in easy way.
70 `OnixS::CME::MDP3::SecurityDefinitionListener`
72 `OnixS::CME::MDP3::MboBookUpdateListener`
73 `OnixS::CME::MDP3::DirectBookUpdateListener`
74 `OnixS::CME::MDP3::ImpliedBookUpdateListener`
75 `OnixS::CME::MDP3::ConsolidatedBookUpdateListener`
77 `OnixS::CME::MDP3::MboBookChangeListener`
78 `OnixS::CME::MDP3::DirectBookChangeListener`
79 `OnixS::CME::MDP3::ImpliedBookChangeListener`
81 `OnixS::CME::MDP3::TradeListener`
82 `OnixS::CME::MDP3::OrderIdListener`
83 `OnixS::CME::MDP3::ElectronicVolumeListener`
85 `OnixS::CME::MDP3::StatisticsListener`
87 `OnixS::CME::MDP3::SecurityStatusListener`
89 `OnixS::CME::MDP3::RequestForQuoteListener`
92 `OnixS::CME::MDH::SecurityListener`
95 Security-related events are now consolidated into single listener.
97 Following important changes were done in the how particular cases
100 - Unknown security definitions are now exposed through the
101 OnixS::CME::MDH::SecurityListener::onUndefined member which
102 also allows to update security attributes like security group,
103 asset, etc. Previously, unknown securities were not exposed
104 through security definition listeners. Instead, Handler raised
105 a warning on absence of definition.
107 - Trade summary processing has been reworked. Previously, SDK exposed
108 separate listeners for trades and order identifiers providing special
109 indexing for linking order ids with the trades. Now, trades are always
110 reported through the same OnixS::CME::MDH::SecurityListener::onTrade
111 callback. Order ids refering to a particular trade summary can be
112 gathered by the Handler and delivered together with a trade summary
113 instance depending on a trade summary handling strategy controlled by
114 OnixS::CME::MDH::HandlerSettings::tradeProcessing parameter value.
115 See \ref trade-order-details for more information.
117 - Previously, maintenance of books of a particular type was enabled by Handler
118 basing on registering instance of listener for that kind of books. Now, as Book
119 update callbacks consolidated into single listener together with the other events
120 maintenance is explicitly defined by corresponding parameters which define whether
121 particular overload of OnixS::CME::MDH::SecurityListener::onBookUpdate will be
122 invoked by the Handler or not.
127 \section migrate-book-management Book Management
129 Previously, maitenance of books of particular type (MBO, direct, implied,
130 consolidated) was automatically enabled by Handler if either corresponding
131 listener was associated with an instance of OnixS::CME::MDH::Handler or
132 book maintenance was forcibly enabled through Handler's settings.
134 Also, depending on which listeners are registered (for example, listener for atomic
135 changes in direct order book), Handler selected appropriate source of recovery data
136 to catch-up up-to-date market state during late join or after detecting gap in incremental
137 data. For example, if user was interested in receiving MBO book updates without subscribing
138 to MBP book updates, Handler listened to recovery data on MBO snapshot feed only without
139 joining snapshot feed for MBP books.
141 In given release, Handler's behavior has been improved to be more clear for the users.
143 Book updates are now exposed through OnixS::CME::MDH::SecurityListener::onBookUpdate
144 members of consolidated listener for security-related data. However, overriding noted
145 virtual member doesn't mean subscribing to a book updates. Book maintenance is explicitly
146 defined by corresponding parameter from OnixS::CME::MDH::HandlerSettings::bookManagement()
149 | Parameter Path | Description |
150 |------------------------------------------------------------------------------|----------------------------------------------------|
151 | `handlerSettings.bookManagement().mboBooks().maintain(bool status)` | Enables or disables MBO books maintenance |
152 | `handlerSettings.bookManagement().directBooks().maintain(bool status)` | Enables or disables direct books maintenance |
153 | `handlerSettings.bookManagement().impliedBooks().maintain(bool status)` | Enables or disables implied books maintenance |
154 | `handlerSettings.bookManagement().consolidatedBooks().maintain(bool status)` | Enables or disables consolidated books maintenance |
156 Once parameter is turned on, Handler invokes OnixS::CME::MDH::SecurityListener::onBookUpdate
157 overload corresponding to the type of book.
159 Also, behavior of the Handler in case of market recovery is now controlled by
160 OnixS::CME::MDH::SessionSettings::marketRecovery parameter. It allows to define
161 explicitly whether Handler must listen and process data from either MBO snapshot
162 feed or MBP snapshot feed or both feeds.
164 Given improvement in behavior of the Handler allows users to obtain desired
165 processing behavior without involving book maintenance.
167 \section migrate-books Book Classes
169 Book classes have been cleaned up. OnixS::CME::MDP3::BookBase::securityId and
170 OnixS::CME::MDP3::BookBase::lastAppliedSecurityLevelSeqNumber members have been
173 Data exposed by eliminated members is now consolidated into a new OnixS::CME::MDH::Security
174 class, containing all security-related attributes. Instances of given class are exposed in
175 all callbacks of OnixS::CME::MDH::SecurityListener listener. Therefore, security identifier
176 and instrument-level sequence number are now available for trade and statistics events.
178 | Old Member | New Member | Description |
180 | `OnixS::CME::MDP3::BookBase::securityId` | `OnixS::CME::MDH::Security::id` | Security id relocated from book to security instance |
181 | `OnixS::CME::MDP3::BookBase::lastAppliedSecurityLevelSeqNumber` | `OnixS::CME::MDH::Security::seqNumber` | Now available in other security-related callbacks |
183 \section migrate-feed-engine Feed Engine
185 Concept of \ref feed-engine was introduced in previous major release of the SDK
186 and given release inherits given concept. However, a few important changes have
189 Previosly, to provide backward compatibility with older minor releases, feed engine
190 could be constructed explicitly and bound with OnixS::CME::MDH::Handler instances.
191 If no instance of OnixS::CME::MDH::FeedEngine was associated with an instance of
192 OnixS::CME::MDH::Handler, then Handler constructed private instance of the feed engine.
194 In given release, implicit construction has been eliminated to provide better clarity
195 on Handler behavior and use of system resources. Therefore, to make live market data
196 processing happen, instance of OnixS::CME::MDH::FeedEngine must be constructed and
197 bound to the instance of OnixS::CME::MDH::Handler.
199 \note There's no limitation on number of feed engine instances constructed.
200 Therefore, having single instance of OnixS::CME::MDH::FeedEngine for each
201 instance of OnixS::CME::MDH::Handler can be easy be achieved by constructing
202 and binding pair of instances.
204 \section migrate-feed-events Feed Events
206 Feed-related events have been redesigned. First of all, direct access to sockets
207 used to listen to multicast data has been eliminated. OnixS::CME::MDP3::FeedSocket
208 class is not available any more. Feed identification in events have been improved
209 and now feed is identified by OnixS::CME::MDH::NetFeed class containing primary
210 attributes of the feed which caused an event.
212 Event listener was enhanced with a new member OnixS::CME::MDH::FeedListener::onFeedPacket
213 allowing to trace market data received by the Handler on a particular feed. An important
214 difference between this callback and the one in OnixS::CME::MDH::MarketDataListener is that
215 given callback is invoked by Handler every time data is received no matter whether this is
216 duplicated or out-of-order data. Given enhancement allows to implement various tracing
217 facilities to determine issues in data reception or its sequencing.
219 OnixS::CME::MDP3::FeedListener::onFeedSequenceIssues event and related with it functionality
220 was removed from the Handler. Instead, OnixS::CME::MDH::FeedListener::onFeedPacket can be used
221 to trace feeds for the issues.
223 \section migrate-instrument-cache Instrument Definition Cache
225 Handler exposes ability to cache instrument definitions received on live instrument
226 feed for further reuse at late join. Previously, Handler used predefined filename and
227 stored cache in a certain location. Therefore, settings exposed boolean parameter
228 OnixS::CME::MDP3::HandlerSettings::cacheSecurityDefinitions which allowed to either
229 enable or disable instrument definition caching.
231 In given release, behavior was been improved and now Handler allows to specify arbitrary
232 filename and location. Instrument definition caching is enabled while non-empty path to
233 the cache is specified through OnixS::CME::MDH::HandlerSettings::instrumentCache parameter.
235 \section migrate-message-processing Message Processing
237 One of major improvements done in given release is redesigned message subsystem.
238 In previous releases, market data was exposed through the OnixS::CME::MDP3::Message
239 class representing an unified container of FIX fields. In given release message
240 subsystem has been redesigned. Now market data messages are exposed to the users
241 as they are defined in XML-based specification published by CME. Given approach
242 gives more clarity on data structure and use and increases robustness.
244 | 3.X Release | 4.X Release |
245 |-------------|-------------|
246 | `OnixS::CME::MDP3::Message` | `OnixS::CME::MDH::ChannelReset` |
247 | | `OnixS::CME::MDH::AdminLogin` |
248 | | `OnixS::CME::MDH::AdminLogout` |
249 | | `OnixS::CME::MDH::InstrumentDefinitionFuture` |
250 | | `OnixS::CME::MDH::InstrumentDefinitionSpread` |
251 | | `OnixS::CME::MDH::InstrumentDefinitionOption` |
252 | | `OnixS::CME::MDH::SecurityStatus` |
253 | | `OnixS::CME::MDH::IncrementalRefreshBook` |
254 | | `OnixS::CME::MDH::IncrementalRefreshOrderBook` |
255 | | `OnixS::CME::MDH::IncrementalRefreshTrade` |
256 | | `OnixS::CME::MDH::IncrementalRefreshTradeSummary` |
257 | | `OnixS::CME::MDH::IncrementalRefreshVolume` |
258 | | `OnixS::CME::MDH::IncrementalRefreshSessionStatistics` |
259 | | `OnixS::CME::MDH::IncrementalRefreshDailyStatistics` |
260 | | `OnixS::CME::MDH::IncrementalRefreshLimitsBanding` |
261 | | `OnixS::CME::MDH::SnapshotFullRefresh` |
262 | | `OnixS::CME::MDH::SnapshotFullRefreshOrderBook` |
263 | | `OnixS::CME::MDH::QuoteRequest` |
265 OnixS::CME::MDH::MarketDataListener as the listener for the received
266 market data was enhanced with overloads for each type of SBE message.
268 Additionaly, since given release original network packets received on live feeds are exposed to the
269 users through OnixS::CME::MDH::MarketDataListener interface as instances of OnixS::CME::MDH::Packet
270 class. Correspondently, listener was enhanced with OnixS::CME::MDH::MarketDataListener::onPacket and
271 OnixS::CME::MDH::MarketDataListener::onEndOfPacket allowing to determine bounds of packet processing.
273 \section migrate-logger Event And Data Logging
275 Logging layer was significantly reworked and abstraction of logging service was introduced. Now
276 users can implement their logging service including memory-based ones. SDK offers ready-to-use
277 implementation for logging events into a file.
279 Following examples depict how to enable file-based logging for the Handler in previous and current releases:
281 \subsection migrate-logger-v3-sample Enabling logging in previous generations of SDK
285 HandlerSettings handlerSettings;
287 handlerSettings.logDirectory("logs");
288 handlerSettings.logMode(LogModes::Debug);
289 handlerSettings.advancedLogOptions(AdvancedLogOptions::LogEverything);
291 Handler handler(handlerSettings);
295 \subsection migrate-logger-v4-sample Enabling logging in latest generation of SDK
299 HandlerSettings handlerSettings;
301 Handler handler(handlerSettings);
305 FileLoggerSettings loggerSettings;
307 loggerSettings.filename("LogFile.txt");
308 loggerSettings.severityLevel(LogSeverity::Debug);
310 FileLogger logger(loggerSettings);
312 handler.bindLogger(logger);
316 For more information see \ref logging-options.
318 \section migrate-replay Log File Replay
320 The behavior of the Handler in case of replaying a log file has been changed.
321 In previous releases, the replay was performed asynchronously. When a user invoked
322 the OnixS::CME::MDH::Handler::start overload, the Handler spawned a new thread.
323 The actual log replay was done in the body of that thread. Therefore, the
324 OnixS::CME::MDH::Handler::start overload returned control to its caller as
325 soon as a new thread was launched. Also, the end of replay could be detected
326 only by using a special listener designed for that purpose.
328 In the given major release, log file replay is a synchronous operation.
329 Therefore, OnixS::CME::MDH::Handler::replay member does not return unless
330 a log file is replayed. The new behavior simplifies user’s interaction with
331 the replay and reduces the use of the system resources.
333 However, the previous behavior of the replay functionality can be achieved.
334 Users may launch additional threads and invoke the OnixS::CME::MDH::Handler::replay
335 in the bodies of those threads. The previous behavior is achieved in such way.
337 \section migrate-filtering Filtering
339 Starting from given release, SDK exposes improved filtering to the users. Previously,
340 market data filtering was managed by set of routines exposed by the OnixS::CME::MDH::Handler
341 class like `OnixS::CME::MDP3::Handler::addSecurityIdFilter`. Also, there were inconsistency
342 related with filtering security definitions which consisted in the fact security definitions
343 were not filtered no matter users were interested in them or not.
345 In given release filtering was been redesigned and eliminates existent albiguities and inconsistencies
346 available in previous releases. According to new concept, filtering is applied to security-related events
347 consolidated into OnixS::CME::MDH::SecurityListener listener. Filtering is not used by the Handler on a
348 market data level, therefore members of OnixS::CME::MDH::MarketDataListener are always invoked under
349 same conditions and filtering has no influence on their invocation.
351 For more information on how security-related events can be filtered, see \ref security-selection.