HornetQ

Managing HornetQ queues via JMS API

HornetQ offers a lot of resource management operations, but unfortunately it is not well covered by documentation ;(
In following tutorial I will try to show you how to manage HornetQ queue via JMS API.

1. Add hornetQ dependencies:

  • As library is available at JBoss AS, I personally prefer to add dependency at scope provided and include module dependency in MANIFEST.MF file
  • In case of debugging, consider adding also artifacts hornetq-server, hornetq-jms-server
2. Add class that will handle invocation of management operations:

3. Invoke adapter from previous point:

  • pay attention at queue address, because jms queues ¬†should starts with prefix jms.queue.*
  • in case of operations parameters, add them as varargs

In the next post I have explained how to find out which management operations are available.