TsgcWSPClient_AMQPEvents › OnAMQPConnect

OnAMQPConnect Event

Fires after the AMQP connection handshake completes successfully (connection.open-ok).

Syntax

property OnAMQPConnect: TsgcAMQPConnectEvent;
// TsgcAMQPConnectEvent = procedure(Sender: TObject) of object

Default Value

Remarks

Raised once the server has answered connection.open-ok, meaning the TCP/WebSocket link, virtual host and connection tuning have all been negotiated. From this point on you can safely call OpenChannel and any channel-level operation. This event is the right place to open your first channel, declare exchanges/queues or start consuming.

Example

procedure TForm1.oAMQPAMQPConnect(Sender: TObject);
begin
  DoLog('#AMQP Connected');
  oAMQP.OpenChannel('channel_1');
end;

Back to Events