TsgcWSPClient_STOMP_RabbitMQEvents › OnRabbitMQPing

OnRabbitMQPing Event

Fires when a heart-beat (single newline) is exchanged with the RabbitMQ broker; reports direction and timestamps of the last exchange.

Syntax

property OnRabbitMQPing: TsgcWSRabbitMQPingEvent;
// TsgcWSRabbitMQPingEvent = procedure(Connection: TsgcWSConnection; aPingMode: TsgcSTOMPPingMode; aLastIncoming: TDateTime; aLastOutgoing: TDateTime) of object

Default Value

Remarks

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:

Example

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;

Back to Events