TsgcWSPClient_STOMP_RabbitMQ › Events › OnRabbitMQPing
Fires when a heart-beat (single newline) is exchanged with the RabbitMQ broker; reports direction and timestamps of the last exchange.
property OnRabbitMQPing: TsgcWSRabbitMQPingEvent;
// TsgcWSRabbitMQPingEvent = procedure(Connection: TsgcWSConnection; aPingMode: TsgcSTOMPPingMode; aLastIncoming: TDateTime; aLastOutgoing: TDateTime) of object
—
Raised whenever a STOMP heart-beat (an end-of-line character) is exchanged with the RabbitMQ broker according to the HeartBeat settings negotiated at connection time. Use this event to monitor the healthiness of the underlying TCP link. Parameters:
sgcstmpIncomingPing (received from the broker) or sgcstmpOutgoingPing (sent by the client).procedure TForm1.RabbitMQPing(Connection: TsgcWSConnection;
aPingMode: TsgcSTOMPPingMode; aLastIncoming: TDateTime;
aLastOutgoing: TDateTime);
begin
if aPingMode = sgcstmpIncomingPing then
Memo1.Lines.Add('heart-beat in @ ' + DateTimeToStr(aLastIncoming))
else
Memo1.Lines.Add('heart-beat out @ ' + DateTimeToStr(aLastOutgoing));
end;