1 \addtogroup tcp-recovery-facility
3 \brief Explains TCP Recovery facility.
5 \section tcp-recovery-concept Recovering from Data Loss
7 The Handler receives market data through the network multicast
8 feeds. Due to a multicast nature, data may come in the wrong order
9 or may be completely lost. The Handler does its best to fix all
10 the network-related issues. However, packet gaps may still happen
11 while processing market data.
13 The CME MDP provides its clients with an ability to request
14 and obtain lost data using a reliable TCP connection. This
15 facility is called a TCP Recovery. If the Handler is configured
16 to use a TCP Recovery facility, in case of data loss, it doesn't
17 report an error immediately and does not fall into a book recovery.
18 Instead, it suspends regular processing and requests a remote system
19 to resend missed data. The Handler resumes regular processing without
20 restarting its execution, once it successfully receives lost packets
24 If a request to recover missed data through a TCP Recovery
25 feed fails, the Handler tries to recover lost packets for a
26 number of times defined by the
27 OnixS::CME::MDH::TcpRecoverySettings::reconnectAttempts
28 parameter. The Handler waits for
29 OnixS::CME::MDH::TcpRecoverySettings::reconnectInterval
30 milliseconds before a new attempt to recover lost data is
31 made. If the Handler was not able to recover lost packets for
32 a predefined number of attempts, it spawns a recovery from
33 snapshots or continues real-time processing as defined by
36 \section enabling-tcp-recovery Enabling TCP Recovery
38 It is necessary to contact CME support for TCP Recovery
39 credentials to be able to use a TCP Recovery facility.
41 Also, the MDP does not allow multiple recovery requests served
42 simultaneously using the same credentials. Only one TCP recovery
43 session can be active at a time. For this reason, the SDK exposes
44 a TCP recovery feature as a shared service which can be bound to
45 multiple Handler instances. Implementation of this feature covers
46 all synchronization related aspects to avoid multiple requests at
49 The following example demonstrates how to use TCP Recovery with the Handler:
53 using namespace OnixS::CME::MDPH;
55 // Configuring TCP Recovery.
57 TcpRecoverySetting tcpRecoverySettings;
59 // Credentials are to be set as there's no defaults for
60 // these parameters. Other parameters have default values.
62 tcpRecoverySettings.username("CME");
63 tcpRecoverySettings.password("CME");
65 // Constructing instance of TCP Recovery
66 // service and binding to the Handler.
68 TcpRecoveryService tcpRecovery(tcpRecoverySettings);
70 // Configuring Handler.
72 HandlerSettings handlerSettings;
74 handlerSettings.channel(310);
75 handlerSettings.feeds().connectivityConfigurationFile("config.xml");
77 Handler handler(handlerSettings);
79 // Since this call, Handler will use
80 // TCP recovery in case of data loss.
81 handler.bindTcpRecovery(tcpRecovery);