Skip to main content

queue_purge

Purges all messages from a specified AMQP queue and displays the count of deleted messages. This function requires an active broker connection and will attempt to reconnect if the channel is unavailable or an error occurs during the operation.

def queue_purge(
amqp_context: object,
queue: string
) - > null

Removes all messages from a specified AMQP queue without deleting the queue itself.

Parameters

NameTypeDescription
amqp_contextobjectThe application context containing the active AMQP channel, connection state, and CLI output utilities.
queuestringThe name of the AMQP queue to be emptied of all pending messages.

Returns

TypeDescription
nullThis function does not return a value; it outputs the count of deleted messages to the console.