TsgcWSPClient_AMQPMethods › DeclareQueueEx

DeclareQueueEx Method

Declares a queue synchronously, waiting for queue.declare-ok.

Syntax

function DeclareQueueEx(const aChannel, aQueue: string; aPassive: Boolean = false; aDurable: Boolean = false; aExclusive: Boolean = false; aAutoDelete: Boolean = false; 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 operation is issued.
aQueueconst stringName of the queue.
aPassiveBooleanWhen True the broker checks whether the object exists and raises an error if it does not, without creating it.
aDurableBooleanWhen True the object survives broker restarts.
aExclusiveBooleanWhen True the queue is restricted to the declaring connection and deleted on disconnect.
aAutoDeleteBooleanWhen True the object is deleted once the last client stops using it.
aNoWaitBooleanWhen True the client does not wait for the broker to confirm the operation.
aTimeoutIntegerMaximum time in milliseconds to wait for the broker confirmation before returning False.
aArgumentsconst stringOptional JSON-encoded field-table with additional arguments.

Return Value

True when the broker acknowledged the declaration within aTimeout. (Boolean)

Remarks

Extended synchronous variant of DeclareQueue. The queue.declare-ok frame also carries message-count/consumer-count which is reported through OnAMQPQueueDeclare.

Example

if sgcWSPClient_AMQP1.DeclareQueueEx('ch1', 'orders', False, True) then
  sgcWSPClient_AMQP1.BindQueue('ch1', 'orders', 'ex.orders', 'orders.*');

Back to Methods