TsgcWSPClient_AMQPEvents › OnAMQPDisconnect

OnAMQPDisconnect Event

Fires when the server or the client closes the AMQP connection (connection.close).

Syntax

property OnAMQPDisconnect: TsgcAMQPDisconnectEvent;
// TsgcAMQPDisconnectEvent = procedure(Sender: TObject; const aClose: TsgcAMQPFramePayload_Method_ConnectionClose; aAck: Boolean) of object

Default Value

Remarks

Raised when a connection.close method is exchanged. aClose contains the reply code, reply text and (when relevant) the class/method id that caused the close, so you can diagnose protocol errors. aAck is True when the client acknowledged a close initiated by the server (connection.close-ok sent) and False when the client itself issued the close. After this event the underlying TCP/WebSocket connection will be terminated.

Example

procedure TForm1.oAMQPAMQPDisconnect(Sender: TObject;
  const aClose: TsgcAMQPFramePayload_Method_ConnectionClose; aAck: Boolean);
begin
  DoLog(Format('#AMQP Disconnected: %d %s (ack=%s)',
    [aClose.ReplyCode, aClose.ReplyText, BoolToStr(aAck, True)]));
end;

Back to Events