LinuxCommandLibrary

rabbitmq-queues

List RabbitMQ queue information

TLDR

Grow quorum queue clusters by adding a member on the specified node

$ rabbitmq-queues grow [node] [all|even]
copy

Rebalance leaders of replicated queues across nodes
$ rabbitmq-queues rebalance [all|quorum|stream]
copy

Shrink quorum queue clusters by removing any members on the specified node
$ rabbitmq-queues shrink [node]
copy

Add a quorum queue member on the specified node
$ rabbitmq-queues add_member [queue] [node]
copy

Delete a quorum queue member on the specified node
$ rabbitmq-queues delete_member [queue] [node]
copy

Display quorum status of a quorum queue
$ rabbitmq-queues quorum_status [queue]
copy

SYNOPSIS

rabbitmq-queues <command> [<queue_name>...] [<options>]

PARAMETERS

list [<queue_name>...]
    Lists queues and their properties. If specific queue names are provided, only those queues are detailed. Supports various output formats and column selections.

purge <queue_name>...
    Removes all messages from one or more specified queues. This action is irreversible and should be used with caution.

delete <queue_name>...
    Deletes one or more specified queues permanently. This action also purges any remaining messages in the queue and should be used carefully.

--vhost <vhost>
    Specifies the virtual host on which to perform the operation. Defaults to '/' if not specified.

--formatter <format>
    Defines the output format. Common formats include json, tsv (tab-separated values), raw, and long.

--columns <cols>
    A comma-separated list of column names to display for list commands (e.g., name,messages,consumers).

--node <node>
    Targets a specific RabbitMQ cluster node for the operation. By default, any online node is targeted.

--force
    Skips confirmation prompts for destructive operations like purge and delete.

--timeout <seconds>
    Sets the maximum time in seconds to wait for the command to complete before exiting.

--online
    Operates only on queues that are currently online and available.

--offline
    Operates only on queues that are currently offline or unavailable.

DESCRIPTION

The rabbitmq-queues command-line tool provides a direct interface for inspecting and manipulating queues within a RabbitMQ cluster. It enables users to perform essential operational tasks such as listing, purging, and deleting queues. This command is particularly useful for scripting, automation, and quick diagnostics of queue states. While offering a dedicated set of functionalities for queues, its capabilities are largely mirrored, and in modern RabbitMQ versions, often superseded by the more comprehensive rabbitmqctl command-line utility. It interacts with the RabbitMQ broker, requiring appropriate user permissions to execute its operations successfully across specified virtual hosts or specific cluster nodes.

CAVEATS

Using rabbitmq-queues purge or delete on production systems can lead to data loss and service disruption. Always exercise caution and ensure proper backups or testing procedures. This command requires appropriate RabbitMQ user permissions (e.g., configure, read, write) on the target virtual host and queues. Operations might be slow for queues with a very large number of messages or for clusters under heavy load. The command's functionality is often an alias or superseded by rabbitmqctl commands in modern RabbitMQ versions.

DEPRECATION AND MODERN ALTERNATIVES

For modern RabbitMQ deployments, it is highly recommended to use rabbitmqctl for queue management. Commands like rabbitmqctl list_queues, rabbitmqctl purge_queue, and rabbitmqctl delete_queue offer equivalent or enhanced functionality and are the preferred methods for interacting with RabbitMQ queues via the command line.

PERMISSIONS REQUIRED

To execute commands successfully, the user connecting to RabbitMQ must have sufficient permissions. For example, list requires read permissions, purge requires write permissions, and delete requires configure permissions on the target queues and virtual host.

OUTPUT FORMATTERS

The --formatter option is powerful for scripting.
json: Outputs data in a machine-readable JSON array of objects.
tsv: Tab-separated values, useful for importing into spreadsheets or other tools.
raw: Minimal output, often just values separated by spaces.
long: A human-readable, multi-line format providing detailed information.

HISTORY

The rabbitmq-queues command originated as a dedicated utility to streamline queue management tasks, offering a focused interface for common operational needs. Over time, as the RabbitMQ management ecosystem evolved, much of its functionality was integrated directly into the more comprehensive rabbitmqctl command. Consequently, in newer RabbitMQ versions, rabbitmq-queues is often considered a legacy tool, with its operations typically achievable through rabbitmqctl list_queues, rabbitmqctl purge_queue, and rabbitmqctl delete_queue commands, which provide a more unified and consistent management experience.

SEE ALSO

rabbitmqctl(8), rabbitmq-server(8), rabbitmq-plugins(8)

Copied to clipboard