TsgcWSPClient_AMQP1 › Events › OnAMQPConnect
Fires after the peer answers with its Open frame, i.e. when the AMQP 1.0 container-level handshake has completed.
property OnAMQPConnect: TsgcAMQP1ConnectEvent;
// TsgcAMQP1ConnectEvent = procedure(Sender: TObject; const aOpen: TsgcAMQP1FrameOpen) of object
—
Raised once the peer has returned its own Open performative. aOpen carries the broker's negotiated parameters: ContainerId, Hostname, MaxFrameSize, ChannelMax, IdleTimeOut, OfferedCapabilities, DesiredCapabilities and Properties. The handler is the correct place to call CreateSession and attach links, because any frame sent before this point would be discarded. When IdleTimeOut is greater than zero the component automatically enables the WebSocket heartbeat at half the negotiated interval.
procedure TForm1.oAMQP1AMQPConnect(Sender: TObject;
const aOpen: TsgcAMQP1FrameOpen);
begin
DoLog('#AMQP1 connected to container ' + aOpen.ContainerId);
oAMQP1.CreateSession('session_1');
end;