TsgcWSPClient_AMQPMethods › BindQueueEx

BindQueueEx Method

Binds a queue to an exchange and waits for the broker confirmation, returning success as a Boolean.

Syntax

function BindQueueEx(const aChannel, aQueue, aExchange, aRoutingKey: string; aNoWait: Boolean = false; aTimeout: Integer = CS_AMQP_DEFAULT_TIMEOUT; const aArguments: string = ''): Boolean;

Parameters

NameTypeDescription
aChannelconst stringName of the open AMQP channel on which the bind is issued.
aQueueconst stringName of the queue to bind.
aExchangeconst stringName of the exchange the queue will be bound to.
aRoutingKeyconst stringRouting key pattern used to match messages published to the exchange.
aNoWaitBooleanWhen True the client does not wait for the broker to confirm the bind.
aTimeoutIntegerMaximum time in milliseconds to wait for queue.bind-ok before returning False.
aArgumentsconst stringOptional JSON-encoded field-table with additional binding arguments.

Return Value

True when the broker acknowledged the bind within aTimeout, False on timeout or error. (Boolean)

Remarks

Synchronous extended variant of BindQueue. Blocks until queue.bind-ok is received from the broker or aTimeout expires. Prefer this variant when the calling code needs to react to bind failures.

Example

if not sgcWSPClient_AMQP1.BindQueueEx('ch1', 'orders', 'ex.orders', 'orders.new') then
  ShowMessage('BindQueue timed out');

Back to Methods