AMQPing v0.4 Released

AMQPing v0.4 Released

Introduction

AMQPing (pypi, github) is a tool based on pika for testing an AMQP broker such as RabbitMQ.

Its been on pypi for a while, but needed some love. Initially it could only connect to a broker successfully or throw an exception. Useful as a very crude monitor but not for anything else.

Version 0.3 was a rewrite with new features and much better error handling. This is based around the click command line framework, which enables amqping to be split into multiple commands that can be used by themselves or chained. It also has great argument/option handling.

Version 0.4 added an exchange type option and a helpful error message if exchange types are mismatched.

So what can I actually use AMQPing for?

The simplest use is “I have a broker running but I’m not sure its working”:

# amqping my_user my_pass my_host ping
Succesfully connected to broker at amqp://my_host:5672/
Created exchange:testexchange and queue:testqueue
Succesfully posted and consumed a test message

Amqping connected to the exchange, created test resources, posted and consumed back a test message, its working!

If you don’t want to leave test resources around and aren’t likely to be doing further testing, then you can add the cleanup command:

# amqping my_user my_pass my_host ping cleanup
Succesfully connected to broker at amqp://my_host:5672/
Created exchange:testexchange and queue:testqueue
Succesfully posted and consumed a test message
Removed queue:testqueue and exchange:testexchange

How about testing if your broker can handle lots of messages?

# amqping my_user my_pass my_host post --messages 50000 mcount purge mcount
Succesfully connected to broker at amqp://my_host:5672/
Created exchange:testexchange and queue:testqueue
Posted 50000 messages to exchange:testexchange with routing key:testkey
There are 100000 messages in queue:testqueue
Purged messages from queue:testqueue
There are 0 messages in queue:testqueue

Using an existing exchange, broker and queue:

# amqping --exchange nova --exchangetype topic --queue notifcations.info \
   --routingkey notifications.info \
   my_user my_pass my_host \
   post mcount purge mcount
Succesfully connected to broker at amqp://my_host:5672/
Created exchange:nova and queue:notifcations.info
Posted 150 messages to exchange:nova with routing key:notifications.info
There are 150 messages in queue:notifcations.info
Purged messages from queue:notifcations.info
There are 0 messages in queue:notifcations.info

Careful using purge on an existing queue that matters.

How do I install AMQPing?

Via pip, the python package manager:

# pip install amqping

How do I report a problem with AMQPing?

Please create an issue on the amqping github repo.