Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 17. JMS Broker


Red Hat JBoss Fuse supports the deployment of JMS brokers. By default, it deploys an Apache ActiveMQ JMS broker. It includes all of the required bundles to deploy additional Apache ActiveMQ instances by deploying a new broker configuration.

17.1. Working with the Default Broker


Red Hat JBoss Fuse starts up with a message broker by default. You can use this broker as it is for your application, or you can update its configuration to suite the needs of your application.


When you deploy a Red Hat JBoss Fuse instance, whether as a standalone container or as a part of a fabric, the default behavior is for a Apache ActiveMQ instance to be started in the container. The default broker creates an Openwire port that listens on port 61616. The broker remains installed in the container and activates whenever you restart the container.

Broker configuration

The default broker's configuration is controlled by two files:
  • etc/activemq.xml—a standard Apache ActiveMQ configuration file that serves as a template for the default broker's configuration. It contains property place holders, specified using the syntax ${propName}, that allow you to set the values of the actual property using the OSGi Admin service.
  • etc/—the OSGi configuration file that specifies the values for the properties in the broker's template configuration file.
For details on how to edit the default broker's configuration see the JBoss A-MQ documentation.

Broker data

The default broker's data is stored in data/activemq. You can change this location using the config command to change the broker's data property as shown in Example 17.1, “Configuring the Default Broker's Data Directory”.

Example 17.1. Configuring the Default Broker's Data Directory

JBossFuse:karaf@root> config:edit
JBossFuse:karaf@root> config:propset data dataStore
JBossFuse:karaf@root> config:update

Disabling the default broker

If you do not want to use the default broker, you can disable it by removing its OSGi configuration file. There are two procedures to follow, depending on whether a Karaf container has been started:
If no Karaf container has been started:
  • Delete FUSE_HOME/etc/
If you have already started a Karaf container, use the following instructions whilst JBoss Fuse is running.
  1. From the JBoss Fuse command console, list the JBoss Fuse brokers: activemq:list
    The result should look like this:
    brokerName = amq
  2. List the configuration PID files: config:list | grep
    The result will look like this:
    FactoryPid: =
       felix.fileinstall.filename = file:/home/username/product/fuse-630/jboss-fuse-6.3.0.redhat-187/etc/
       service.factoryPid = =
       felix.fileinstall.filename = file:/home/username/product/fuse-630/jboss-fuse-6.3.0.redhat-187/etc/ =
       service.factoryPid = =
  3. Delete the configuration PID files labeled Pid: in the example above.
    Note that your files will have the same names as those shown above until the last numeric portion of the the file name, which is a system generated ID for the broker. Replace the filenames in the instructions with your actual filename.
  4. List the JBoss Fuse brokers again: activemq:list
    The deleted broker will not appear.
  5. To permanently delete the default broker:
    Stop the JBoss Fuse instance.
    Delete file FUSE_HOME/etc/
    Restart the JBoss Fuse instance and run the activemq:list command. The deleted broker will not appear.