The SDK offers improved and enhanced market data processing session. Now the Handler allows using a TCP recovery while books are naturally refreshed or combining join-time recovery with natural refresh and so forth.
A set of parameters defining a market data processing session's behavior are gathered into the OnixS::CME::ConflatedUDP::AdvancedSessionSettings class. The OnixS::CME::ConflatedUDP::HandlerSettings class exposes an instance of the given class through the OnixS::CME::ConflatedUDP::HandlerSettings::session` member.
Settings allow defining whether market data recovery must be performed at the beginning of market data processing or in case of data loss or other processing error, and so on. Also, settings define which type of market (by price or by order or both) to recover. Finally, the settings tell the Handler whether to use the TCP recovery to request missing data before recovering the market state from snapshots.
The table below describes the primary parameters affecting market data processing:
Parameter | Description | Behavior Visualization |
---|---|---|
OnixS::CME::ConflatedUDP::AdvancedSessionSettings::joinRecovery | Defines whether the Handler must recover either instruments or the entire market state, or nothing when it joins a trading session. For a complete list of available options see OnixS::CME::ConflatedUDP::JoinRecoveryOptions::Enum items.
| |
OnixS::CME::ConflatedUDP::AdvancedSessionSettings::gapAndErrorHandling | When real-time market data is processed, a failure may take place due to errors in transmitted data or due to data loss. The Handler allows controlling its behavior in such cases. With the help of the given parameter, it's possible to specify whether processing real-time market data should continue or the Handler must recover market state to have accurate order books. Also, the Handler may recover all instruments in addition to the market state to have an accurate list of traded securities. See the OnixS::CME::ConflatedUDP::GapAndErrorHandlingOptions::Enum for a complete list of available options.
| |
OnixS::CME::ConflatedUDP::AdvancedSessionSettings::instrumentRecovery | The given parameter tells the Handler how to recover security definitions. If the processing session has to perform instrument recovery due to either late join or processing failure, the given parameter affects the way security definitions are recovered. By default, the Handler processes recovery data from the beginning of a recovery loop to have the correct set of available instruments. If the Handler joins the feed in the middle of a loop, it waits till its end. When the number of security definitions being looped is significant, it takes a while for the Handler to get all instrument definitions recovered. Also, data loss causes the Handler to process security definitions from the beginning of the next loop. As a result, client systems using the Handler may need for a faster way of recovering security definitions. For this reason, the SDK offers alternative ways of recovering instrument definitions client systems may take advantage of. For a complete list of options, see OnixS::CME::ConflatedUDP::InstrumentRecoveryOptions::Enum. | |
OnixS::CME::ConflatedUDP::AdvancedSessionSettings::marketRecovery | The given parameter controls aspects of the Handler behavior in case of market recovery. If the processing session has to perform market state recovery due to either late join or processing failure, the given parameter allows defining a type of market to recover. | |
OnixS::CME::ConflatedUDP::AdvancedSessionSettings::tcpRecovery | The given set of parameters controls aspects of the Handler behavior in case of TCP Recovery. If a valid instance of the OnixS::CME::ConflatedUDP::TcpRecoveryService is associated by the OnixS::CME::ConflatedUDP::TcpRecoverySessionSettings::service parameter, the Handler tries to recover missing incremental data before it switches recovering market state from snapshots or resumes incremental data processing depending on the value of the OnixS::CME::ConflatedUDP::AdvancedSessionSettings::gapAndErrorHandling parameter. |
The following code snippet depicts how to configure a market data processing session to maintain order books accurately starting from the middle of a trading session (a.k.a. late join).
The following code snippet depicts how to configure a market data processing session to maintain MBP books accurately starting from the beginning of a trading session when the market is at a blank state (thus, no initial recovery is needed to catch-up an up-to-date market state).
The following code snippet depicts how to configure market data processing to maintain order books in the natural refresh mode and to perform a full state recovery at a join stage. The given configuration is frequently used when a server doing market data processing is collocated in the CME network, and the possibility of data loss is minimal. It gives almost the same benefits as an accurate order book maintenance. Still, it does not let real-time processing freeze due to necessity in performing market recovery in case of data loss.
The following code snippet helps to configure market data processing to maintain order books in natural refresh mode. However, in contrast to a typical case, when real-time processing is resumed immediately, in the given case, the Handler tries to recover missing data using TCP Recovery Feed.