TsgcWSPClient_AMQP1 › Methods › CreateSession
Begins an AMQP 1.0 session on the container by sending a Begin frame and returns the resulting session object.
function CreateSession(const aName: string = ''; const aOptions: TsgcAMQP1MethodOptions_SessionOpen = nil) : TsgcAMQP1Session;
| Name | Type | Description |
|---|---|---|
aName | const string | Local identifier for the session. Used as the lookup key by CloseSession, CreateSenderLink and CreateReceiverLink. Leave blank to let the component generate one. |
aOptions | const TsgcAMQP1MethodOptions_SessionOpen | Optional per-session tuning (next-outgoing-id, incoming/outgoing windows, handle-max, desired/offered capabilities). Pass nil to use the defaults from AMQPOptions. |
The newly created TsgcAMQP1Session instance once the peer has replied with Begin. (TsgcAMQP1Session)
An AMQP 1.0 connection carries one or more independently flow-controlled sessions, each identified by its channel number. This method allocates a free channel, sends a begin performative and stores the returned session under aName. When the broker responds with its own Begin the OnAMQPSessionOpen event fires and sender/receiver links can then be attached to the session. The session object returned is the same instance later passed to the Session/Link/Message events.
oSession := oAMQP1.CreateSession('session_1');