queue_delete
Deletes a specified AMQP queue and reports the number of messages deleted, optionally enforcing constraints that the queue must be unused or empty. This function requires an active broker connection and will attempt to reconnect if the channel is unavailable or an error occurs during the deletion process.
def queue_delete(
amqp_context: object,
queue: string,
if_unused: boolean,
if_empty: boolean
) - > null
Deletes a specified queue from the AMQP broker, optionally enforcing constraints on whether the queue must be empty or unused.
Parameters
| Name | Type | Description |
|---|---|---|
| amqp_context | object | The context object containing the active AMQP channel and CLI configuration. |
| queue | string | The name of the queue to be removed from the broker. |
| if_unused | boolean | If set to true, the queue will only be deleted if it has no active consumers. |
| if_empty | boolean | If set to true, the queue will only be deleted if it contains zero messages. |
Returns
| Type | Description |
|---|---|
null | Nothing is returned directly, but the number of deleted messages is printed to the console upon success. |