Session – Heartbeat Protocol
The Heartbeat is useful for monitoring the status of the communication link and to identify when the last of a string of messages was not received.
When either end of a FIX connection has not sent any data for [HeartBtInt] seconds, it will transmit a Heartbeat message. When either end of the connection has not received any data for (HeartBtInt + some reasonable transmission time) seconds, it will transmit a Test Request message. If there is still no heartbeat message received after (HeartBtInt + some reasonable transmission time) seconds then the connection should be considered lost and corrective action be initiated. If HeartBtInt is set to zero then no regular heartbeat messages will be generated. Note that a Test Request message can still be sent independent of the value of the HeartBtInt which will force a Heartbeat message.
Heartbeats issued as the result of Test Request must contain the TestReqID transmitted in the Test Request message. This is useful to verify that the Heartbeat is the result of the Test Request and not as the result of a regular timeout.
The heartbeat format is as follows:
Tag | Field Name | Req'd | Description |
---|---|---|---|
8 | BeginString | Y | FIX.4.0 (Always unencrypted, must be first field in message) |
9 | BodyLength | Y | (Always unencrypted, must be second field in message) |
35 | MsgType | Y | (Always unencrypted, must be third field in message) |
49 | SenderCompID | Y | (Always unencrypted) |
56 | TargetCompID | Y | (Always unencrypted) |
115 | OnBehalfOfCompID | N | Trading partner company ID used when sending messages via a third party (Can be embedded within encrypted data section.) |
128 | DeliverToCompID | N | Trading partner company ID used when sending messages via a third party (Can be embedded within encrypted data section.) |
90 | SecureDataLen | N | Required to identify length of encrypted section of message. (Always unencrypted) |
91 | SecureData | N | Required when message body is encrypted. Always immediately follows SecureDataLen field. |
34 | MsgSeqNum | Y | (Can be embedded within encrypted data section.) |
50 | SenderSubID | N | (Can be embedded within encrypted data section.) |
57 | TargetSubID | N | “ADMIN” reserved for administrative messages not intended for a specific user. (Can be embedded within encrypted data section.) |
116 | OnBehalfOfSubID | N | Trading partner SubID used when delivering messages via a third party. (Can be embedded within encrypted data section.) |
129 | DeliverToSubID | N | Trading partner SubID used when delivering messages via a third party. (Can be embedded within encrypted data section.) |
43 | PossDupFlag | N | Always required for retransmissions, whether prompted by the sending system or as the result of a Resend Request. (Can be embedded within encrypted data section.) |
97 | PossResend | N | Required when message may be duplicate of another message sent under a different sequence number. (Can be embedded within encrypted data section.) |
52 | SendingTime | Y | (Can be embedded within encrypted data section.) |
122 | OrigSendingTime | N | Required for message resends. If data is not available set to same value as SendingTime (Can be embedded within encrypted data section.) |
112 | TestReqID | N | Required when the heartbeat is the result of a Test Request message. |
93 | SignatureLength | N | Required when trailer contains signature. Note: Not to be included within SecureData field |
89 | Signature | N | Note: Not to be included within SecureData field |
10 | CheckSum | Y | (Always unencrypted, always last field in message) |