Connecting to Backup Sessions
If a connection to the primary host has been dropped, CME allows to connect to backup host:
- CME Globex initiates failover by electing the ranking inactive designated backup Drop Copy Gateway to assume the primary role.
- The client application should connect to the newly promoted primary Drop Copy Gateway.
- If the primary connection fails and the client system connects to the newly promoted primary Drop Copy Gateway, that instance will begin with the next available outbound sequence number to the client. Outbound sequence number could be higher due to unprocessed in-flight messages.
- Once connected to the new instance, sequence numbers on outbound messages from the client system to Drop Copy must begin with the next available sequence number from tag 34-MsgSeqNum of the previously available Drop Copy gateway instance.
- After failover, Drop Copy may resend previously transmitted messages with tag 97-PossResend=Y on real-time messages.
Handler supports connection to the backup host via providing a new host IP address.
Example
Following example demonstrates how to switch to backup host:
Handler handler = new Handler("SenderCompId", "SenderSubId", "Segment");
handler.ExecutionReportReceived += new EventHandler<MessageEventArgs>(handler_ExecutionReportReceived);
handler.MassOrderCancelReportReceived += new EventHandler<MessageEventArgs>(handler_MassOrderCancelReportReceived);
handler.Logon(primaryHost, primaryPort, accessKey, secretKey);
// Some network or gateway failure occurs so there is need to switch to backup host
handler.Logon(backupHost, backupPort, accessKey, secretKey);