LinuxCommandLibrary

rabbitmq-plugins

Manage RabbitMQ server plugins

TLDR

List plugins

$ rabbitmq-plugins list
copy

Enable a plugin
$ rabbitmq-plugins enable [plugin]
copy

Disable a plugin
$ rabbitmq-plugins disable [plugin]
copy

Enable a plugin and disable the rest
$ rabbitmq-plugins set [plugin]
copy

SYNOPSIS

rabbitmq-plugins [-n <node>] [-l <log_level>] [--online | --offline] <command> [plugin ...] [options]

PARAMETERS

-n <node>
    Specifies the RabbitMQ node name (e.g., rabbit@hostname). Defaults to rabbit@localhost.

-l <log_level>
    Sets the log level for rabbitmq-plugins itself (e.g., info, warning, error).

--online
    Explicitly indicates that the command should operate with the RabbitMQ node running. This is the default.

--offline
    Indicates that the command should operate with the RabbitMQ node stopped. Essential for certain plugin operations.

--silent
    Suppresses most informational output.

--verbose
    Produces more verbose output.

--json
    Formats output as JSON (primarily for the list command).

list [-E <regexp>] [-m <mode>] [--silent] [--verbose] [--json]
    Lists installed plugins.
-E <regexp>: Filters plugins by a regular expression.
-m <mode>: Filters by plugin mode (enabled, disabled, all).

enable <plugin> [...<plugin>] [--offline] [--silent]
    Enables one or more specified plugins.

disable <plugin> [...<plugin>] [--offline] [--silent]
    Disables one or more specified plugins.

install <plugin> [...<plugin>] [--online] [--silent]
    Installs one or more specified plugins, making them available to the broker.

remove <plugin> [...<plugin>] [--online] [--silent]
    Removes one or more specified plugins, making them unavailable to the broker.

update
    Updates plugin metadata cache. (Less common, usually for specific scenarios).

debug
    Displays various debug information about plugins and the plugin loader.

DESCRIPTION

The rabbitmq-plugins command-line tool is an essential utility for managing plugins on a RabbitMQ broker node. Plugins extend the core functionality of RabbitMQ, providing features such as the management UI, MQTT and STOMP protocol adapters, federation, shovels, and more.
This command allows administrators to list available plugins, enable or disable specific plugins, install new ones, and remove existing ones. It interacts directly with the RabbitMQ server, either online (when the server is running) or offline (when the server is stopped, requiring the --offline flag). Proper use of rabbitmq-plugins is crucial for customizing and enhancing a RabbitMQ deployment to meet specific messaging requirements.

CAVEATS

Most enable and disable operations require the RabbitMQ node to be stopped if dependencies are not met or if the plugin significantly alters the runtime environment; in such cases, use the --offline flag.
Changes made using rabbitmq-plugins often require a restart of the RabbitMQ node to take full effect.
Enabling or disabling a plugin can have dependency implications. The command will attempt to resolve and warn about missing dependencies or dependent plugins that will also be affected.
Running rabbitmq-plugins may require elevated privileges (e.g., sudo) depending on the system's user permissions for the RabbitMQ installation directories and runtime files.

PLUGIN DEPENDENCIES

RabbitMQ plugins can have dependencies on other plugins. When enabling a plugin, rabbitmq-plugins will automatically attempt to enable its dependencies. If a required dependency is missing or cannot be enabled, the operation will fail with an informative error message. Similarly, disabling a plugin might affect other plugins that depend on it.

PLUGIN LOCATION

RabbitMQ plugins are typically distributed as .ez files (Erlang Zip archives). These files are placed in a designated plugins directory, which RabbitMQ scans for available plugins. The install and remove commands often interact with this directory, though manual placement is also possible. The default location can vary by installation method but is commonly found under /usr/lib/rabbitmq/lib/rabbitmq_server-<version>/plugins/ or similar paths.

HISTORY

The rabbitmq-plugins command has been an integral part of the RabbitMQ distribution since its early days, evolving alongside the broker's plugin architecture. Initially, plugins were managed through configuration files or by directly manipulating the plugins directory. The command-line tool streamlined this process, providing a consistent and robust interface for administrators.
Significant developments include the introduction of the --offline flag, which greatly simplified plugin management in clustered or production environments by allowing safe operations on stopped nodes, and the addition of JSON output for easier integration with automation scripts and monitoring tools. Its design reflects the growing complexity and extensibility of the RabbitMQ ecosystem.

SEE ALSO

Copied to clipboard