Skip to content
All library documents

Diagnosing FIX Session Disconnects and Heartbeat Expectations

Article Quant Q&A · Author: Taimoor Choudhary

Summary

This exchange addresses a market data session that stopped receiving snapshots after a broker reported missing client heartbeats. The key diagnostic is that client heartbeats and server initiated test requests are distinct messages with different expected responses. The respondent interprets the reported sequence as evidence that the client had sent heartbeats successfully, while the broker may have sent a test request that the application failed to acknowledge. Confirming the broker’s specific FIX message and response requirements is presented as the practical next step.

The discussion also explains that heartbeat intervals depend on trading activity and connection needs. An interval suitable for low frequency use may be too long for high frequency activity, where liveness should be checked before sending orders. It does not provide a QuickFIX/n configuration recipe or establish the broker’s actual behavior from logs; its diagnosis relies on the original account and follow-up details. Operators should verify message logs and counterpart expectations for their own FIX version and session configuration.

Key ideas

  • A client heartbeat and a server test request are different FIX messages and may require different handling.
  • A session can disconnect if an application fails to respond to a broker initiated test request.
  • Ask the counterparty which message it sends and what response it expects when testing session liveness.
  • Set heartbeat timing according to trading frequency and operational needs.
  • The diagnosis depends on the reported session details and should be confirmed against the broker’s logs and configuration.

Tags

Full text
# FIX Heartbeat message not sent


# FIX Heartbeat message not sent












I am using FIX4.3 and QuickFIX/n v1.0.0 for its implementation.

I came across a situation where i had subscribed for Market Data and was successfully receiving Snapshot message then suddenly all communication with the Market Session stopped and i didn't receive any more snapshot from the server on the Market Data Session.

When i asked the support they said that they didn't receive any heartbeat from my end so they closed the connection.

When i look at my FIX log files i see that time between my last heartbeat and the last snapshot from the server is under 60 seconds. And i didn't receive any logout message from the server either.

Also during all this time my Order Session stayed connected with proper heartbeat message.

My Questions are:

- What might have caused the system to not send out a Heartbeat message?

- Is it normal for the server to close connection on missing 1 heartbeat message? My understanding was that in case there is no heartbeat from the client, server will send a test request.

- Using QuickFIX/n how can i ensure my periodic heartbeat message?

- Whats the best time interval for heartbeat? (Mine is currently set to 60 seconds)

## Answer by Matt Wolf (score 1)

https://quant.stackexchange.com/a/3973

Taking the information given in your question and subsequent follow up, I believe the following is the issue at hand:

The heart beats you send out are good practice but are irrelevant in regards to your specific problem. It looks like your brokers sends out periodic "heart beats" (= test requests) on its own and if your application does not respond then it disconnects. I would not entirely rely on the specific Fix version (build) but rather inquire with the broker what specific message is sent through FIX and what they expect back to keep you alive. You most likely need to reply with a message to acknowledge the "test request". That most likely will solve your problem.

Regarding your other questions:

1) You answered that yourself, you actually sent out the heartbeats and the broker received them, thus no problems here.

2) ...which the server did (sending out a test request). Make sure you understand there is a difference between you sending out heart beats and the broker sending out his own heartbeats.

3) See 1) no problem there, you sent them out, they were received

4) It entirely depends on your trading frequency. Obviously before sending out FIX messages you want to make sure the connection is alive, other than that if you trade high frequency 60 seconds is way too infrequent. If your trade frequency is a lot lower then 60 seconds may be sufficient.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.