TsgcWSPClient_AMQP1Events › OnAMQPClose

OnAMQPClose Event

Fires when an AMQP 1.0 Close frame is received from the peer, carrying the optional error that terminated the container.

Syntax

property OnAMQPClose: TsgcAMQP1CloseEvent;
// TsgcAMQP1CloseEvent = procedure(Sender: TObject; const aError: TsgcAMQP1FrameError) of object

Default Value

Remarks

Raised when the peer sends a close performative (channel 0), either in response to a local Close or because the broker is terminating the connection. aError is nil on a clean close; otherwise it contains the AMQP error Condition symbol (for example amqp:connection:framing-error, amqp:unauthorized-access or a vendor-specific condition such as com.microsoft:timeout), a human-readable Description and an optional Info map. After this event the underlying transport is shut down, so OnAMQPDisconnect fires next.

Example

procedure TForm1.oAMQP1AMQPClose(Sender: TObject;
  const aError: TsgcAMQP1FrameError);
begin
  if Assigned(aError) then
    DoLog(Format('#AMQP1 close: %s - %s',
      [aError.Condition, aError.Description]))
  else
    DoLog('#AMQP1 close: clean');
end;

Back to Events