Skip to content

smartrecruiters/rabbitr

Repository files navigation

rabbitr

Build Software License Go Report Card Go Doc

Rabbitr

Small CLI application written in GoLang for easier management of RabbitMQ related tasks.

Implemented features

  • connections
    • list
    • close
  • messages
    • download
    • upload
    • move
  • queue
    • list
    • purge
    • sync
    • delete
  • exchange
    • list
    • delete
  • server
    • add
    • delete
    • list
  • shovels
    • delete
    • list
  • policies
    • list

Installation

Tapping the repo

brew tap smartrecruiters/public-homebrew-taps git@github.com:smartrecruiters/public-homebrew-taps.git

Installing

brew update && brew install rabbitr

Configuration

After downloading or building the source code rabbitr application needs to be configured with coordinates to RabbitMQ servers that it will operate on. It uses REST API when communicating with RabbitMQ server. To add server configuration invoke:

rabbitr server add -s my-server-name -api-url http://localhost:15672 -u user -p pass

After the server has been configured it can be used in context of other commands such as queues

Usage

Each command comes with a description and examples. Start with rabbitr -h to check all the commands. Lower level commands provide their own usage, for example rabbitr queues -h or rabbitr queues list -h

"Example flow"

Example commands:

rabbitr server add -s my-server-name -api-url http://localhost:15672 -amqp-url amqp://localhost:5672 -u user -p pass
rabbitr queues list -s my-server-name
rabbitr queues sync -s my-server-name
rabbitr queues list -s my-server-name --filter="queue.Consumers==0"
rabbitr queues list -s my-server-name --filter="queue.Consumers==0 && queue.Messages>=200"
rabbitr queues purge -s my-server-name --filter="queue.Consumers==0 && queue.Messages>=200"
rabbitr messages move -s my-server-name --src-vhost vhost1 --src-queue test-queue --duplicate"
rabbitr messages download -s my-server-name -v vhost1 --queue "sample-queue" --output-dir /tmp --verbose --max-messages=100
rabbitr messages upload -s my-server-name -v vhost1 --queue "sample-queue-new" --input-dir /tmp --confirm --max-messages=100

Advanced filtering

Rabbitr uses goevaluate library for dynamic filtering of the resources. It can be useful to determine list of subjects that match given criteria. It allows for creating flexible conditions considering for example only queues with particular name, vhost, defined number of consumers or messages. Check command descriptions for a list of properties available for use on given resource type.