23 Feb 2011

Load tests with ActiveMQ


Not sure everyone knows it but ActiveMQ has a maven plug-in that can be easily used to run load tests. Its name is maven-activemq-perf-plugin. Full documentation is available here.
As I often need to run test using a specific broker configuration or having to test a specific broker feature, this plug-in has helped me a few times already. It is also highly useful for trouble shooting as the many configuration options allow you to simulate certain broker usage patterns.

You have many options for setting up the load test like the number of producers and consumers, the message size, acknowledge mode, using Queues or Topics, whether to use JMS transactions and many more.
It also includes samplers that measure your performance; you get a nice summary written at the end of the test run.


In order to use the test suite, simply add it the plug-in to your pom. An example is given here.

I highly recommend it to anyone who wants to quickly run some load tests and measure broker throughput.

2 comments:

Torsten Mielke said...

I have recently added a few improvements to this plugin:

- consumer/producer throttling (AMQ-3186)
- message selector in the consumer (AMQ-3280)
- message headers (AMQ-3280)
- fixed broken transaction support (AMQ-3283)

At the time of writing this comment, these fixes are only available in the trunk version.
Plugin documentation got updated as well.

Torsten Mielke said...

Another recent addition to this plugin is the ability to send a fixed message that is loaded from a file using configuration property producer.msgFileName.
See updated plug-in documentation:
http://activemq.apache.org/activemq-performance-module-users-manual.html