Using the ActiveMQ list command

The list command can be used to list out the brokers currently running inside the Karaf container.

Getting ready

In order to get started, we need to get the activemq-broker feature installed. Reference the activemq:query command, as shown in the following screenshot:

Getting ready

How to do it…

To list out all brokers currently running embedded inside this instance of Karaf, we can simply run the following command:

karaf@root()> activemq:list

This will list out the embedded broker names as follows:

brokerName = amq-broker

How it works…

This activemq command will invoke the JmxMBeansUtil.getAllBrokers class on the JMX connection and ...

Get Apache Karaf Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.