In the regular case, the Handler keeps checking incoming packets transmitted by MDP for gaps and uses recovery facilities like TCP Recovery and snapshot feeds to keep order books in the up-to-date state. When market data loss occurs, the Handler spawns market recovery using the market recovery feed. While recovering market, the real-time market data is cached, and thus, market data processing looks like suspended.
Natural refresh of order books supposes processing of real-time (incremental) market data without involving market recovery. As a result, the Handler processes the real-time market data as soon as it is received from the feeds. As a drawback, order books may not be fully recovered, and thus, some price levels may be absent.
When recovery facilities are used, order books exposed by the Handler are always fully reconstructed and in τς up-to-date state. When books are naturally refreshed, a part of price level information may be absent.
To differ whether order book is fully recovered or just partly reconstructed, OnixS::CME::MDH::MboBook and OnixS::CME::MDH::MbpBook classes expose OnixS::CME::MDH::MboBook::state and OnixS::CME::MDH::MbpBook::state members correspondently. Returned value identifies whether book is fully reconstructed (OnixS::CME::MDH::BookStates::Latest) or naturally refreshed (OnixS::CME::MDH::BookStates::NaturallyRefreshed).
When an order book is naturally refreshed, some price levels may be absent. Price level data types (OnixS::CME::MDH::DirectPriceLevel, OnixS::CME::MDH::ImpliedPriceLevel) expose members (OnixS::CME::MDH::DirectPriceLevel::exist(), OnixS::CME::MDH::ImpliedPriceLevel::exist()) to check whether actual data is available for particular bid or ask.
The following code depicts how to run the Handler in natural refresh mode:
In other words, natural refresh defines the behavior of the Handler in case of data loss and other issues while processing real-time data. Since this major release, the Handler provides the ability to combine natural refresh with other facilities like performing initial instrument and market recovery as well as TCP recovery to request lost data.
The following example depicts how the Handler and its processing session can be configured to combine natural refresh with an initial late join recovery.