Skip to main content

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

NameTypeDescription
amqp_contextobjectThe context object containing the active AMQP channel and CLI configuration.
queuestringThe name of the queue to be removed from the broker.
if_unusedbooleanIf set to true, the queue will only be deleted if it has no active consumers.
if_emptybooleanIf set to true, the queue will only be deleted if it contains zero messages.

Returns

TypeDescription
nullNothing is returned directly, but the number of deleted messages is printed to the console upon success.