TsgcWSPClient_STOMP_ActiveMQ › Events › OnActiveMQPing
Fires when a heart-beat (single newline) is exchanged with the ActiveMQ broker; reports direction and timestamps of the last exchange.
property OnActiveMQPing: TsgcWSActiveMQPingEvent;
// TsgcWSActiveMQPingEvent = 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 ActiveMQ 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.ActiveMQPing(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;