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.
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.
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.
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.
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.