This article will provide more details on how to use ActiveMQ in Apache Karaf, small OSGi based runtime. Apache Karaf was previously know as ServiceMix kernel, so informations found here are applicable to Apache ServiceMix Enterprise Service Bus as well.
Procedures described in this article were tested using Apache karaf 2.3.0
ActiveMQ provides Karaf features which will help you integrate and use the broker in OSGi environment. For starters you need to add the features URL to Karaf. For version 5.9.0 you can do it like this:
After that you should see newly added features
Installing and running the broker is as simple as installing
This will install and start the full broker (including the web console), just as if you started the standalone distribution.
Broker is configured using OSGi Config Admin mechanism and could be easily managed in Karaf. Configuration can be done by modifying
Mandatory properties are listed in the following table
You can also use this file to set other properties which will replace placeholders in XML configuration file, as the
Default XML configuration file is located in the
Web Console is installed by default and can be reached at http://localhost:8181/activemqweb/
The configuration for the console is done in a similar fashion to the broker itself. Configuration is located in
Optional: In order to use the ActiveMQ console with a broker configured with authentication, it is necessary to configure the username/password for JMS connection as well.
After these simple steps you have all necessary libraries installed in the container. Also, now you have specific commands on your disposal that you can use to manage your broker:
Help on commands
To obtain some detailed help on a given command, you can run:
Several commands are available to query the broker. To address local brokers, you need to use the
The following command displays available brokers:
To have more detailed informations, run:
It will display informations about the connectors, list of queues, etc...
You can also browse or purge queues using the