TsgcWSPClient_STOMP_ActiveMQ › Properties › HeartBeat
Negotiates the STOMP 1.1/1.2 heart-beat header so the client and the ActiveMQ broker exchange keep-alive newlines and detect silent drops.
property HeartBeat: TsgcWSSTOMPHeartBeat_Options read FHeartBeat write SetHeartBeat;
Enabled=True, Incoming=0, Outgoing=0
Heartbeat is enabled by default but only takes effect when the negotiated protocol is STOMP 1.1 or 1.2 (heart-beat is not defined in 1.0). Outgoing is the minimum interval in milliseconds at which the client guarantees to send data to the broker; Incoming is the smallest interval the client is willing to accept from the broker. Both values are emitted in the CONNECT frame as heart-beat: <Outgoing>,<Incoming> and ActiveMQ returns its own pair in CONNECTED; the effective intervals are the pairwise maximums. A value of 0 disables that direction. When no other frame has been written within Outgoing ms the client sends a single newline (0x0A) as the STOMP heartbeat, which fires OnActiveMQPing in sgcstmpOutgoingPing mode; inbound newlines fire it in sgcstmpIncomingPing mode. When a TsgcWebSocketClient is attached, setting HeartBeat.Enabled := True also mirrors Outgoing (converted to seconds) onto the WebSocket-level HeartBeat.Interval so the ping fires from the WebSocket timer.
STOMP.HeartBeat.Enabled := True;
STOMP.HeartBeat.Outgoing := 10000;
STOMP.HeartBeat.Incoming := 10000;