OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.0
API documentation

What Is Log Replay?

Log replay feature provides the ability to save time and money when to pay for connection to the Production Environment and this takes a lot of money. Instead this the Handler can record all events occurring on the Exchange and in the future be able to play them repeatedly. All you need to do is to save log files.

Log Replay Settings

Before using a Handler to play the log files, it is necessary to prepare the appropriate settings. The instance of OnixS::ICE::iMpact::MarketData::HandlerSettings created and OnixS::ICE::iMpact::MarketData::HandlerSettings::logs should be filled by passing only path(s) to log file(s). The Handler constructor OnixS::ICE::iMpact::MarketData::Handler::Handler takes this settings and handler reads all Base64-based data from the log file and processes these data as data received from the network.

Log Replay Events

During log replay, the Handler may cause errors. If this happens Handler calls the special callback OnixS::ICE::iMpact::MarketData::ErrorListener::onError. When replay log is finished the Handler calls the OnixS::ICE::iMpact::MarketData::LogReplayListener::onReplayFinished.

Note
The OnixS::ICE::iMpact::MarketData::LogReplayListener::onReplayFinished event doesn't trigger the Handler to switch to the OnixS::ICE::iMpact::MarketData::HandlerStates::Stopped state. If a user wants this transition it is required to call the OnixS::ICE::iMpact::MarketData::Handler::stop() method explicitly.

Timestamps

For replayed packets, the Handler uses the same timestamps as available in the log file. It's actual for both TCP and UDP data. The timestamp is available in OnixS::ICE::iMpact::MarketData::MessageInfo::receiveTime and in OnixS::ICE::iMpact::MarketData::Packet::time if the user uses OnixS::ICE::iMpact::MarketData::PacketProcessingListener.

Replay Multiple Log Files

The Handler can generate more than one log file. This depends on the Handler's settings but if you want to record the whole trading day and then replay this data you will need to deal with multiple log files.

In order to replay the data from the multiple log files you need to add all the log files to OnixS::ICE::iMpact::MarketData::HandlerSettings::logs in order they have been created. You should keep this order as there is no logic to sort the log records and the Handler will just read all the data sequentially.

Note
Log replay for multiple sessions is not supported. If you started and stopped the Handler several times for a single log file the log replay can't be used as it will normally replay the first session and then failed.