TsgcWSPClient_AMQP1Methods › CreateSenderLink

CreateSenderLink Method

Attaches an AMQP 1.0 sender link to an existing session and returns it, ready to publish messages to the supplied target address.

Syntax

function CreateSenderLink(const aSession: string; const aName: string = ''; const aTarget: string = ''; const aOptions: TsgcAMQP1MethodOptions_CreateSenderLink = nil) : TsgcAMQP1SenderLink;

Parameters

NameTypeDescription
aSessionconst stringName of the session previously returned by CreateSession. The link is attached to this session's channel.
aNameconst stringLink name advertised in the Attach frame. Must be unique within the session for a given role. Blank generates one automatically.
aTargetconst stringTarget node address messages will be sent to — for example a queue or topic name, or an Azure Service Bus entity path.
aOptionsconst TsgcAMQP1MethodOptions_CreateSenderLinkOptional Attach options (snd-settle-mode, rcv-settle-mode, durable/expiry-policy/timeout, source address, desired-capabilities, link credit).

Return Value

The newly attached TsgcAMQP1SenderLink instance, usable with SendMessage once the peer confirms the Attach. (TsgcAMQP1SenderLink)

Remarks

In AMQP 1.0 data flows over unidirectional links attached to a session. A sender link has role false (sender) and transfers messages from this container to the peer node addressed by aTarget. The method writes an attach performative with the supplied name, target and options, and when the peer mirrors it the link becomes attached. OnAMQPLinkOpen fires at that point and OnAMQPMessageSentAck afterwards reports delivery outcomes. Use CloseLink to detach.

Example


oSender := oAMQP1.CreateSenderLink('session_1', 'sender_1', 'queue-orders');

Back to Methods