The Handler receives market data through the network multicast feeds. Due to a multicast nature, data may come in the wrong order or may be completely lost. The Handler does its best to fix all the network-related issues. However, packet gaps may still happen while processing market data.
The CME MDP provides its clients with an ability to request and obtain lost data using a reliable TCP connection. This facility is called a TCP Recovery. If the Handler is configured to use a TCP Recovery facility, in case of data loss, it doesn't report an error immediately and does not fall into a book recovery. Instead, it suspends regular processing and requests a remote system to resend missed data. The Handler resumes regular processing without restarting its execution, once it successfully receives lost packets from the service.
If a request to recover missed data through a TCP Recovery feed fails, the Handler tries to recover lost packets for a number of times defined by the OnixS::CME::MDH::TcpRecoverySessionSettings::attempts parameter.
It may happen the missing data is not sent due to the TCP recovery service malfunctioning. It happens, the counterpart sends heartbeats but requested data is not transmitted. In such cases, the Handler may stop processing real-time data for a undefined time. To prevent from being locked in the TCP recovery, the Handler allows to limit the time it spends in recovering missing data. The limit can be established or updated by using the OnixS::CME::MDH::TcpRecoverySessionSettings::servingTimeLimit parameter.
If the Handler is not able to recover lost packets for a predefined number of attempts or the allocated time for recovery is out, it spawns a recovery from snapshots or resumes real-time processing as defined by other session settings.
It is necessary to contact CME support for TCP Recovery credentials to be able to use a TCP Recovery facility.
Also, the MDP does not allow multiple recovery requests served simultaneously using the same credentials. Only one TCP recovery session can be active at a time. For this reason, the SDK exposes a TCP recovery feature as a shared service which can be bound to multiple Handler instances. Implementation of this feature covers all synchronization related aspects to avoid multiple requests at the same time.
The following example demonstrates how to use TCP Recovery with the Handler: