As well as installing the libraries needed for running a Fuse Message Broker broker, the
activemq
feature also provides a set of console commands for
managing and monitoring broker instances.
If you do not already have a broker configuration file, the
activemq:create-broker
console command provides a simple way of
creating a new broker instance with default settings. To create a new broker with
the broker name, test
, enter the following console command:
karaf@root> activemq:create-broker --name test
After executing this command, you should see the broker configuration file,
test-broker.xml
, in the
directory. You can
edit the settings in this file in order to change the broker configuration. As soon
as any changes are saved to the InstallDir
/deploytest-broker.xml
file, the OSGi
container re-reads the broker configuration.
![]() | Note |
---|---|
If the |
Broker instances created using the activemq:create-broker
command are
configured to store their data in the following directory:
InstallDir
/data/activemq/BrokerName
You can use the activemq:destroy-broker
console command to remove a
broker instance. For example, to destroy the broker named test
, enter
the following console command.
karaf@root> activemq:destroy-broker --name test
Alternatively, you can simply delete the file, test-broker.xml
, from
the hot deploy directory,
.InstallDir
/deploy
You can use the activemq:query
console command to monitor the status
of the broker (or possibly brokers) currently deployed in the container. The
following command connects to the container's JMX port and downloads
all of the broker's status:
karaf@root> activemq:query --jmxlocal
Typically, the amount of data retrieved by this command is unwieldy. It is better
to filter the data by selecting specific queues or topics. For example, to view the
status of all queues whose name starts with camel.
, enter the following
command:
karaf@root> activemq:query --jmxlocal -QQueue=camel.*
For more details, see the activemq:query
help text, by entering
activemq:query --help
.
As an alternative to querying the broker with the activemq:query
command, you can monitor the broker through any JMX monitoring tool, such as
JConsole (a standard utility provided with Sun's Java Development Kit). For an
example of how to monitor the broker using JConsole, see JMS Endpoints in a Router Application.