TsgcWSPClient_AMQP1 › Events › OnAMQPSessionOpen
Fires when the peer answers a session Begin frame, confirming the session has been opened on its channel.
property OnAMQPSessionOpen: TsgcAMQP1SessionOpenEvent;
// TsgcAMQP1SessionOpenEvent = procedure(Sender: TObject; const aSession: TsgcAMQP1Session; const aBegin: TsgcAMQP1FrameBegin) of object
—
Raised once the peer has returned its own begin performative in reply to the client's Begin. aSession is the session object created by CreateSession; aBegin carries the remote parameters: RemoteChannel echoed back, NextOutgoingId, IncomingWindow, OutgoingWindow, HandleMax (upper bound on link handles on this session) and any OfferedCapabilities / Properties. This is the right place to attach the first links via CreateSenderLink / CreateReceiverLink.
procedure TForm1.oAMQP1AMQPSessionOpen(Sender: TObject;
const aSession: TsgcAMQP1Session; const aBegin: TsgcAMQP1FrameBegin);
begin
DoLog('#AMQP1 session opened: ' + aSession.Name);
oAMQP1.CreateReceiverLink(aSession.Name, 'receiver_1', 'queue-orders');
end;