Skip to main content

A simple tool to send and receive messages to and from rabbitmqexchanges and queues

Project description

Rabbitholer

img

img

Abstract

Rabbitholer is a very simple tool for communicating with a RebbiMQ server over AMQP protocol. It uses the pika library for python and it offers convenient command line interface for sending and receiving messages to and from a RabbitMQ server instance. Rabbitholer is essentially a lightweight AMQP client.

I wrote this because I often had to debug RabbitMQ messages while working on different projects. The web management plugin for RabbitMQ can be convenient but it doesn’t really integrate with the other command line utilities I am used to (GNU core utilities). I’ve designed Rabbitholer along the lines of the minimalism idea because I wanted it to be as versatile as possible. Easy integration with other utilities is a core design principle here.

Installation

Usage

A basic run of rabitholer --help gives:

usage: rabitholer [-h] [--version] [--verbose] Command ...

Interact with RabbitMQ exhanges and queues

optional arguments:
  -h, --help      show this help message and exit
  --version, -v   Print veriosn inormation
  --verbose, -vv  Print a lot of information about the execution.

Commands:
  A list of the avialble commands

  Command
    send          Send a message to an exchange
    read          Send a messages to an exchange read from the standard input.
    pipe          Create a named pipe connected to an exchange
    monitor       Monitor the messges on an exchange

Currently there are four supported commands: send, read, pipe and monitor. All commands have certain arguments that are common between all of them. Those instruct the application how to connect to the server. They include:

Argument Description
--server, -s The IP of the RabbitMQ. Standard port is assumed (5672).
--exchange, -e The name of the exchange to be declared while connecting.
--queue, -q The name of the queue to be bound to the exchange while connecting.
--routing, -r The routing key to be used for outgoing messages.

Different arguments may influence different commands. For example, when receiving messages, the routing key does not play a role. The exchange will be declared as non-passive, non-durable and non-auto-delete and of type fanout. This means that the application can connect to an existing exchange. To note is however that if the exchange already exists, it must be of type fanout. The queue will be declared as non-auto-delete. Both the exchange and the queue have default names of “general”. These are the names that will be used unless specified otherwise thought the command line arguments. If not specified, the routing key will be left as an empty string. You can read more about the RabbitMQ exchanges and queues here (complete reference guide) and here (quick explantion of the AMQP model).

send: Simply sends a message to the specified exchange with the specified routing key.

Intended to be used like:

rabbitholer send <msg>

Multiple messages can be send like:

rabbitholer send "<msg1>" "<msg2>" ...

read: Reads the standard output and dumps it on the specified exchange with the specified routing key. Each line is treated as a separate message.

The intended use is something like:

echo '<msg>' | rabbitholer read

monitor: Reads messages from a queue and dumps them on the standard output - each message is on separate line.

Example use:

rabbitholer read | grep "id:"

pipe: Creates a named pipe connected to a running instance of the application. Any input to the pipe will be send as a message to the server. The intended use is:

rabbitholer pipe ./rabbithole

then you can do something like:

echo '<msg>' > ./rabbithole

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rabbitholer-0.0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

rabbitholer-0.0.2-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file rabbitholer-0.0.2.tar.gz.

File metadata

  • Download URL: rabbitholer-0.0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for rabbitholer-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c39e6408450b9512c590fc921249ab67c6069cf1d60e6fdb93810bb8abe4eee3
MD5 dc26bc85be022735d16b585da8682f6d
BLAKE2b-256 a378b6670b5d414fd97e05131271cdbd7c2eea3277b4622ba72f17cfeedab0d8

See more details on using hashes here.

File details

Details for the file rabbitholer-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rabbitholer-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for rabbitholer-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca2118f1d3b49089006fc6bb3a3aed52676cf2f673d57d55b0720189dfa400b0
MD5 31a33b77acfd840b2b6851f9b2bf7817
BLAKE2b-256 ab960cfd172e457a6b468d201ba498238f90e997768685e9388cd4f22fd0963c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page