Java Tools

This page documents some Java-based utility programs (performance, tracing).

Performance tool

The performance tool distribution contains Java programs to run various performance scenarios and some HTML utility to display graphs of the performance runs.

The distribution contains a script (runjava or runjava.bat) to run Java with the class path correctly configured, e.g. runjava com.rabbitmq.perf.PerfTest runs the PerfTest Java class.

PerfTest

PerfTest is a performance testing tool. It starts up zero or more producers and consumers and reports the rate at which messages are sent and received, along with the latency (i.e. time taken for messages to pass through the broker).

PerfTest supports many command line flags. Invoke it with --help to see them:

runjava com.rabbitmq.perf.PerfTest --help

Some examples:

runjava com.rabbitmq.perf.PerfTest -a
Send transient messages without acknowledgement, 1 producer and 1 consumer.
runjava com.rabbitmq.perf.PerfTest -c 1000
Similar, but with acknowledgments and confirms.
runjava com.rabbitmq.perf.PerfTest -c 1000 -f persistent
...with acknowledgments, confirms and persistence.
runjava com.rabbitmq.perf.PerfTest -y0 -p -u my-queue -s 1000 -C 1000000
Fill a pre-declared queue with 1M transient messages of 1kB each
runjava com.rabbitmq.perf.PerfTest -x0 -y10 -p -u another-queue
Start 10 consumers from a predeclared queue, and no producers.

If a queue name is defined (-u "queue-name"), PerfTest will create a queue with this name and all consumers will consume from this queue. The queue will be bound to the direct exchange with its name as the routing key. The routing key will be used by producers to send messages. This will cause messages from all producers to be sent to this single queue and all consumers to receive messages from this single queue.

If the queue name is not defined, PerfTest will create a random UUID routing key with which producers will publish messages. Each consumer will create its own anonymous queue and bind it to the direct exchange with this routing key. This will cause each message from all producers to be replicated to multiple queues (number of queues equals number of consumers), while each consumer will be receiving messages from only one queue. When using PerfTest without a queue name it makes sense to set ratesMode for consumer to producerRatesMode * producersCount For example:

runjava com.rabbitmq.perf.PerfTest -x100 -y100 -r2 -R200

HTML Performance Tools

The HTML Performance Tools are a set of tools that can help you run automated benchmarks by wrapping around the PerfTest benchmarking framework. You can provide benchmark specs, and the tool will take care of running the benchmark, collecting results and displaying them in an HTML page. Learn more here.

Download and source code

Releases

Source code

Tracer

The tracer is a very basic, very simple AMQP protocol analyzer. Use it with the runtracer or runtracer.bat script:

runtracer listenPort connectHost connectPort
listenPort
port to listen for incoming AMQP connections on - defaults to 5673.
connectHost
hostname to use when making an outbound connection in response to an incoming connection - defaults to localhost.
connectPort
port number to use when making an outbound connection - defaults to 5672.

Download and source code

Releases

Source code