Can I remove queue consumers using the broker's JMX interface?

Solution Verified - Updated -

Environment

  • Fuse Message Broker 5.x
  • Fuse MQ Enterprise 7.x
  • JBoss A-MQ 6.0

Issue

Is it possible to unregister certain JMS consumers using the broker's JMX interface?

Resolution

There is no JMX API to disconnect a queue consumer from the broker. There is an API to create and delete durable topic subscriptions under the Broker MBean operations. This however does not work for queue consumers and it does not work for non-durable topic subscriptions.

However you have the option of closing certain connections in JMX. If you drill into the org.apache.activemq.Connections, you have a few JMX operations on each individual connection. One of them is stop(), which will close the JMS connection and will also remove all of the JMS consumers that share this connection.
If these clients however are still running and use the failover protocol, they will automatically reconnect within a few milliseconds.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.