OnixS ICE iMpact Multicast Price Feed Handler C++ library 8.18.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Log Replay

What Is Log Replay?

The log replay feature saves time and money by reducing the cost of connecting to the Production Environment. Instead, the Handler can record all events on the Exchange and, in the future, play them back repeatedly. All you need to do is save the log files.

Log Replay Settings

Before using a Handler to play the log files, you must prepare the appropriate settings. The instance of HandlerSettings created and HandlerSettings::logs should be filled by passing only path(s) to log file(s). The Handler constructor Handler::Handler takes these settings, and the handler reads all Base64-Encoded data from the log file and processes it as network data.

Log Replay Events

During log replay, the Handler may cause errors. If this happens, the Handler calls the special callback ErrorListener::onError. When the replay log completes, the Handler calls the LogReplayListener::onReplayFinished.

Note
The LogReplayListener::onReplayFinished event doesn't trigger the Handler to switch to the HandlerStates::Stopped state. If a user wants this transition, they must explicitly call the Handler::stop() method.

Timestamps

For replayed packets, the Handler uses the same timestamps as available in the log file. It applies to both TCP and UDP data. The timestamp is available in MessageInfo::receiveTime and in Packet::time if the user uses PacketProcessingListener.

Replay Multiple Log Files

The Handler can generate multiple log files. This depends on the Handler's settings, but if you want to record the entire trading day and then replay the data, you will need to handle multiple log files.

In order to replay the data from the multiple log files, you need to add all the log files to HandlerSettings::logs in the order they were 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 normally replays the first session and then fails.