Skip to main content

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

Metadata

Release files for rabbitholer 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rabbitholer 0.0.2
File Size Uploaded
rabbitholer-0.0.2.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rabbitholer 0.0.2
File Interpreter ABI Platform
rabbitholer-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / rabbitholer-0.0.2.tar.gz

Download URL rabbitholer-0.0.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c39e6408450b9512c590fc921249ab67c6069cf1d60e6fdb93810bb8abe4eee3
BLAKE2b-256 checksum
How to use checksums
a378b6670b5d414fd97e05131271cdbd7c2eea3277b4622ba72f17cfeedab0d8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / rabbitholer-0.0.2-py3-none-any.whl

Download URL rabbitholer-0.0.2-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca2118f1d3b49089006fc6bb3a3aed52676cf2f673d57d55b0720189dfa400b0
BLAKE2b-256 checksum
How to use checksums
ab960cfd172e457a6b468d201ba498238f90e997768685e9388cd4f22fd0963c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page