OnixS C++ CME MDP Premium Market Data Handler  5.8.9
API Documentation
Instrument Recovery options

The instrument-definition-feeds constantly loop "Security Definition" messages and thus lets a client system and the handler obtain the current set of instruments available on a channel. Any additions, modifications, and deletions to available instruments are reflected as soon as a new loop of the recovery data begins. By default, the handler processes recovery data from the beginning of a loop to have an accurate 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. As a result, client systems using the handler may need a faster way of recovering security definitions. For this reason, the SDK offers several instrument recovery strategies.

The following table describes instrument recovery options exposed by the SDK:

Event Description
OnixS::CME::MDH::InstrumentRecoveryOptions::Accurate

This strategy tells the handler to recover instruments most accurately. In particular, the handler processes Instrument Definition messages from the beginning of a recovery loop. If the handler joins the Instrument Recovery feed in the middle of a recovery loop, incoming data is ignored until a new loop begins. Also, suppose the handler detects a gap in a sequence of incoming packets. In that case, it will stop processing Instrument Definitions till the end of a loop and restart the recovery from the beginning of a new loop.

The given way to recover instruments is recommended for the channels where user-defined instruments are frequently added or removed during the trading week.

Note
The accurate recovery may take longer due to the necessity to wait for the beginning of a new loop caused by joining at the middle of a last loop or data loss.
OnixS::CME::MDH::InstrumentRecoveryOptions::Fast The fast mode allows starting processing Instrument Definition messages from the middle of a recovery loop without waiting for the beginning of the next loop. In case of data loss, missing definitions are recovered from the following loops. This approach allows recovery quicker. However, the recovered set of instruments may not be accurate because of differences in the recovery loops from where the recovery data was taken.

The OnixS::CME::MDH::SessionSettings::instrumentRecovery member allows defining the instrument definitions recovery strategy.

The following code shows how to tell the handler to recover instruments quicker than the standard approach:

Handler handler;
handler.settings().session().instrumentRecovery(InstrumentRecoveryOptions::Fast);
handler.start();
Warning
The handler joins the Incremental feed before starting the processing of the Instrument Recovery data. During the recovery, Incremental data is queued by the handler and replayed upon the recovery completion. The given behaviour reduces the chances of losing changes in the set of available instruments.