|Table of Contents|
Using callbacks during the recovery.
The recovery process is started when there is inconsistent Market Data for a particular Instrument. At the start of the recovery process, the following callback is fired:
/// Fired when recovery is started /// @param subsItem Description of the instrument virtual void InstrumentListener::onRecoveryStarted( SpectraSubscriptionItem const& subsItem );
During the recovery onSnapshot and onIncriment callbacks are fired to provide a user with the most recent Market Data that the Adapter has and the data can be applied:
The Market Data for an instrument can be considered as actual only after onRecoveryStopped callback:
/// Fired when recovery is ended /// @param subsItem Description of the instrument /// @param reason Reason of recovery virtual void InstrumentListener::onRecoveryStopped( SpectraSubscriptionItem const& subsItem, RecoveryReason reason );
It means that the recovery process has been done and Market Data is in a consistent state.
How MOEX Spectra Market Data Adapter reacts on Sequence Reset message
The new type of messages (a message 'Sequence Reset') was introduced in Spectra FAST protocol specification v 1.4.2.
MOEX Spectra Market Data Adapter handles Sequence Reset message in the following way:
A Sequence Reset message received in Incremental feed initiates recovery mechanism for all subscribed instruments.
In this case, callbacks Spectra::InstrumentListener::onRecoveryStarted() and Spectra::InstrumentListener::onBookReset() are fired.
- Sequence filtering mechanism isn't applied to Sequence Reset messages.
Therefore, OnRecoveryStarted and OnBookReset callbacks would be fired for each sequence reset message (i.e. twice due to A-B arbitrage).