TsgcWSPClient_AMQP1Methods › CreateSession

CreateSession Method

Begins an AMQP 1.0 session on the container by sending a Begin frame and returns the resulting session object.

Syntax

function CreateSession(const aName: string = ''; const aOptions: TsgcAMQP1MethodOptions_SessionOpen = nil) : TsgcAMQP1Session;

Parameters

NameTypeDescription
aNameconst stringLocal identifier for the session. Used as the lookup key by CloseSession, CreateSenderLink and CreateReceiverLink. Leave blank to let the component generate one.
aOptionsconst TsgcAMQP1MethodOptions_SessionOpenOptional per-session tuning (next-outgoing-id, incoming/outgoing windows, handle-max, desired/offered capabilities). Pass nil to use the defaults from AMQPOptions.

Return Value

The newly created TsgcAMQP1Session instance once the peer has replied with Begin. (TsgcAMQP1Session)

Remarks

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.

Example


oSession := oAMQP1.CreateSession('session_1');

Back to Methods