rabbitmq / rabbitmq-cli

Command line tools for RabbitMQ
Other
105 stars 34 forks source link
cli elixir rabbitmq

RabbitMQ CLI Tools

This was migrated to https://github.com/rabbitmq/rabbitmq-server

This repository has been moved to the main unified RabbitMQ "monorepo", including all open issues. You can find the source under /deps/rabbitmq_cli. All issues have been transferred.

Overview

Build Status

This repository contains RabbitMQ CLI tools (rabbitmqctl and others).

This generation of CLI tools first shipped with RabbitMQ 3.7.0.

Goals

Team RabbitMQ wanted a set of tools that

Supported RabbitMQ Versions

Long lived branches in this repository track the same branch in RabbitMQ core and related repositories. So master tracks master in rabbitmq-server, v3.7.x tracks branch v3.7.x in rabbitmq-server and so on.

Please use the version of CLI tools that come with the RabbitMQ distribution version installed.

Building

Requirements

Building this project requires

Command line tools depend on rabbitmq-common. Dependencies are being resolved by erlang.mk

Building Standalone Executables

This repo produces a rabbitmqctl executable which can be used as different tools (rabbitmq-plugins, rabbitmq-diagnostics, rabbitmq-queues, rabbitmq-streams, rabbitmq-upgrade) by copying or symlinking it with different names. Depending on the name, a different set of commands will be loaded and available, including for --help.

To generate the executable, run

make

Usage

rabbitmqctl

See rabbitmqctl help and rabbitmqctl man page for details.

rabbitmq-plugins

See rabbitmq-plugins help and rabbitmq-plugins man page for details.

rabbitmq-diagnostics

See rabbitmq-diagnostics help and rabbitmq-diagnostics man page.

Testing

See CONTRIBUTING.md.

Developing

Adding a New Command

Conventions

RabbitMQ CLI tools use module name conventions to match the command-line actions (commands) to modules. The convention is outlined in the CommandBehaviour module.

Command Module Interface

Each command module must implement the RabbitMQ.CLI.CommandBehaviour behaviour, which includes the following functions:

There are also a number of optional callbacks:

Tutorial

We have a tutorial that demonstrates how to add a CLI command that deletes a queue.

Examples

See lib/rabbitmq/cli/ctl/commands/status_command.ex and test/status_command_test.exs for minimalistic but not entirely trivial examples.

Copyright and License

The project is licensed under the MPL, the same license as RabbitMQ.

(c) 2007-2020 VMware, Inc. or its affiliates.