TsgcWSPClient_AMQPEvents › OnAMQPChannelClose

OnAMQPChannelClose Event

Fires when a channel is closed by either peer (channel.close).

Syntax

property OnAMQPChannelClose: TsgcAMQPChannelCloseEvent;
// TsgcAMQPChannelCloseEvent = procedure(Sender: TObject; const aChannel: string; const aChannelClose: TsgcAMQPFramePayload_Method_ChannelClose; aAck: Boolean) of object

Default Value

Remarks

Raised when a channel.close method is exchanged. aChannel identifies the channel being closed, aChannelClose contains the reply code, reply text and the class/method id that triggered the close (useful to diagnose things like access-refused, not-found or precondition-failed errors). aAck is True when the client acknowledged a server-initiated close (channel.close-ok sent) and False when the client itself issued the close. The channel is no longer usable after this event.

Example

procedure TForm1.oAMQPAMQPChannelClose(Sender: TObject; const aChannel: string;
  const aChannelClose: TsgcAMQPFramePayload_Method_ChannelClose; aAck: Boolean);
begin
  DoLog(Format('#AMQP Channel %s closed: %d %s',
    [aChannel, aChannelClose.ReplyCode, aChannelClose.ReplyText]));
end;

Back to Events