Joe Miller bio photo

Joe Miller

Ops/Engineering. Continuous DevOping at Webscale

Twitter Github

If you have read @ripienaar’s excellent series of articles on common messaging patterns you probably noticed a handy CLI tool for working with STOMP queues called stompcat. I looked around for something similar for AMQP brokers but couldn’t find anything quite the same. There is amqp-utils but I had some issues with these and the tools didn’t work quite like I was hoping. So I wrote amqpcat with the idea of providing a similar tool to stompcat.

Available on github and

Installation is easy:

sudo gem install amqpcat --no-rdoc --no-ri

1:1 Messaging demonstration

Publish a message:

$ echo "hello there" | amqpcat amqp://guest:guest@rabbitmq -t direct -n --publisher

Receive the message:

$ amqpcat amqp://guest:guest@rabbitmq -t direct -n --consumer
hello there

Pretty simple. There are various other options, run with -h to see them all. You can easily load-balance amongst multiple consumers by starting multiple consumers with the same url and options. See the example for a demo of this.

1:N / PubSub Messaging

Start 2 (or more) consumers:

$ amqpcat amqp://rabbitmq -t fanout -n test.fanout -s "Consumer-1: " --consumer &
$ amqpcat amqp://rabbitmq -t fanout -n test.fanout -s "Consumer-2: " --consumer &

Publish a message:

$ echo "hello there" | amqpcat amqp://guest:guest@rabbitmq -t fanout -n test.fanout --publisher

You should see both consumers receive the message, ie:

Consumer-1: hello there
Consumer-2: hello there

See for a similar example.

SSL support

SSL support (server verification, and client certs) has been written into the tool but I have not been able to test it to a working state yet.