Artemis on Apache Karaf

Apache ActiveMQ Artemis is OSGi ready. Below you can find instruction on how to install and configure broker on Apache Karaf OSGi container.

Installation

Apache ActiveMQ Artemis provides features that makes it easy to install the broker on Apache Karaf (4.x or later). First you need to define the feature URL, like

  1. karaf@root()> feature:repo-add mvn:org.apache.activemq/artemis-features/1.3.0-SNAPSHOT/xml/features

This will add Artemis related features

  1. karaf@root()> feature:list | grep artemis
  2. artemis | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | Full ActiveMQ Artemis broker with default configuration
  3. netty-core | 4.0.32.Final | | Uninstalled | artemis-1.3.0-SNAPSHOT | Netty libraries
  4. artemis-core | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis broker libraries
  5. artemis-amqp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis AMQP protocol libraries
  6. artemis-stomp | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis Stomp protocol libraries
  7. artemis-mqtt | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis MQTT protocol libraries
  8. artemis-hornetq | 1.3.0.SNAPSHOT | | Uninstalled | artemis-1.3.0-SNAPSHOT | ActiveMQ Artemis HornetQ protocol libraries

Feature named artemis contains full broker installation, so running

  1. feature:install artemis

will install and run the broker.

Configuration

The broker is installed as org.apache.activemq.artemis OSGi component, so it’s configured through ${KARAF_BASE}/etc/org.apache.activemq.artemis.cfg file. An example of the file looks like

  1. config=file:etc/artemis.xml
  2. name=local
  3. domain=karaf
  4. rolePrincipalClass=org.apache.karaf.jaas.boot.principal.RolePrincipal
NameDescriptionDefault value
configLocation of the configuration file${KARAF_BASE}/etc/artemis.xml
nameName of the brokerlocal
domainJAAS domain to use for securitykaraf
rolePrincipalClassClass name used for role authorization purposesorg.apache.karaf.jaas.boot.principal.RolePrincipal

The default broker configuration file is located in ${KARAF_BASE}/etc/artemis.xml