TsgcWSPClient_AMQPProperties › HeartBeat

HeartBeat Property

Sends AMQP heartbeat frames periodically to keep the connection alive and to detect silent broker drops.

Syntax

property HeartBeat: TsgcWSAMQPHeartBeat_Options read FHeartBeat write SetHeartBeat;

Default Value

Enabled=True, Interval=60, Timeout=0

Remarks

Heartbeat is enabled by default. When HeartBeat.Enabled is True, the client proposes Interval (seconds) to the broker in Connection.TuneOk; the effective value is the minimum of the client proposal and the heartbeat the server advertised in Connection.Tune. The client then sends an AMQP heartbeat frame (type 8, channel 0, zero payload) whenever no other frame has been sent within that interval, and the broker does the same. Timeout is the number of seconds the client waits without receiving any traffic before closing the connection; set it to 0 to disable the timeout check (AMQP 0-9-1 spec suggests dropping after two missed heartbeats, i.e. 2 * Interval). The OnAMQPHeartBeat event fires every time a heartbeat frame is received. Heartbeat frames traverse any WebSocket or raw-TCP transport identically.

Example


oAMQP.HeartBeat.Enabled := True;
oAMQP.HeartBeat.Interval := 60;
oAMQP.HeartBeat.Timeout := 0;

Back to Properties