TsgcWSPClient_AMQP1Methods › CreateReceiverLink

CreateReceiverLink Method

Attaches an AMQP 1.0 receiver link to an existing session and returns it, ready to consume messages from the supplied source address.

Syntax

function CreateReceiverLink(const aSession: string; const aName: string = ''; const aSource: string = ''; const aOptions: TsgcAMQP1MethodOptions_CreateReceiverLink = nil) : TsgcAMQP1ReceiverLink;

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.
aSourceconst stringSource node address messages will be read from — for example a queue or topic subscription, or an Azure Service Bus entity path.
aOptionsconst TsgcAMQP1MethodOptions_CreateReceiverLinkOptional Attach options (snd-settle-mode, rcv-settle-mode, initial credit, durable/expiry-policy, filter map, distribution-mode, desired-capabilities).

Return Value

The newly attached TsgcAMQP1ReceiverLink instance which will deliver messages through OnAMQPMessage. (TsgcAMQP1ReceiverLink)

Remarks

A receiver link has role true (receiver) and transfers messages from the peer's aSource node to this container. The method writes an attach performative with the given name, source and options, grants initial link credit and, when the peer mirrors the Attach, OnAMQPLinkOpen fires. Every subsequent Transfer from the broker is surfaced via OnAMQPMessage together with a DeliveryState var parameter so the handler can accept, reject, release or modify the delivery. Use CloseLink to detach.

Example


oReceiver := oAMQP1.CreateReceiverLink('session_1', 'receiver_1', 'queue-orders');

Back to Methods