This is an old revision of the document!
Heartbeat
Session Integrity
Heartbeats provide (application-level) connectivity during a FIX session. The heartbeat message maintains the communication link when transactional messages (e.g. trading order routing message) are not received. Under normal conditions, the client and T4 FIX API server will interchange heartbeats at the pre-determined periodic interval (30 seconds). Heartbeats are acknowledged by the counterparty through the generation of a subsequent “echo” heartbeat.
When no message is received within the periodic interval, a heartbeat time-out condition is encountered. Thereafter, a heartbeat is sent to the non-responding party. Upon further unresponsiveness, a <span style="color:blue;">Test Request</span> message follows. The requested party must respond to the <span style="color:blue;">Test Request</span> message with a Heartbeat message containing the TestRequestID (Tag 112) sourced from the <span style="color:blue;">Test Request</span> message. Failure to generate a heartbeat for such test request will result in a <span style="color:blue;">Logout</span> with the subsequent termination of the current FIX Session.
Please note that regardless of time-out conditions, Test Requests can be sent by either party at any time. Correspondingly, a heartbeat with a TestRequestID (Tag 112) must be responded to the initiating party.
Message Dictionary
| Tag | Field Name | Req'd | Comments | |------|----------------------|-------|-------------------------------------------------------------------------| | | '''[Standard Header]''' | Y | MsgType = 0 | | 112 | TestReqID | N | Required when the heartbeat is the result of a Test Request message | | | '''[Standard Trailer]''' | Y | |
Sample Messages
Normal Heartbeat: 34=43|49=T4Example|56=T4|50=T4FIX|52=20120905-17:54:49.359| [FIXHEARTBEAT] [MsgSeqNum] 34 = 43 [SenderCompID] 49 = T4Example [TargetCompID] 56 = T4 [SenderSubID] 50 = T4FIX [SendingTime] 52 = 20120905-17:54:49.359 A Heartbeat as a response to a Test Request: 34=123|49=T4|56=T4Example|50=TraderName|52=20120905-18:09:12.103|112=treqid.09.05.2012-13.09.12| [FIXTESTREQUEST] [MsgSeqNum] 34 = 123 [SenderCompID] 49 = T4 [TargetCompID] 56 = T4Example [SenderSubID] 50 = TraderName [SendingTime] 52 = 20120905-18:09:12.103 [TestReqID] 112 = treqid.09.05.2012-13.09.12