TsgcWSPClient_AMQP › Methods › BindQueueEx
Binds a queue to an exchange and waits for the broker confirmation, returning success as a Boolean.
function BindQueueEx(const aChannel, aQueue, aExchange, aRoutingKey: string; aNoWait: Boolean = false; aTimeout: Integer = CS_AMQP_DEFAULT_TIMEOUT; const aArguments: string = ''): Boolean;
| Name | Type | Description |
|---|---|---|
aChannel | const string | Name of the open AMQP channel on which the bind is issued. |
aQueue | const string | Name of the queue to bind. |
aExchange | const string | Name of the exchange the queue will be bound to. |
aRoutingKey | const string | Routing key pattern used to match messages published to the exchange. |
aNoWait | Boolean | When True the client does not wait for the broker to confirm the bind. |
aTimeout | Integer | Maximum time in milliseconds to wait for queue.bind-ok before returning False. |
aArguments | const string | Optional JSON-encoded field-table with additional binding arguments. |
True when the broker acknowledged the bind within aTimeout, False on timeout or error. (Boolean)
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.
if not sgcWSPClient_AMQP1.BindQueueEx('ch1', 'orders', 'ex.orders', 'orders.new') then
ShowMessage('BindQueue timed out');