Chapter 10. Deploying a New Broker Instance
Abstract
Red Hat JBoss Fuse supports the deployment of multiple JMS brokers in a container. Doing so involves creating a new set of broker configurations and deploying them to the container.
Overview
Deploying a new broker instance involves creating a new OSGi broker configuration and deploying it into the container. In a standalone container this can be done from the command console using the config command shell. For containers deployed in a fabric, you need to either create a profile for the new broker, or modify an existing profile to include the new broker configuration.
You will also likely want to create a new Apache ActiveMQ template configuration file that allows you to modify the desired settings. This will involve creating a new Apache ActiveMQ XML file and making it accessible to container.
Standalone containers
To deploy a new broker into a standalone container:
- Create a template Apache ActiveMQ XML configuration file in a location that is accessible to the container.
- In the JBoss Fuse command console, use the config:edit command to create a new OSGi configuration file.ImportantThe PID must start with
io.fabric8.mq.fabric.server-
. - Use the config:propset command to associate your template XML configuration with the broker OSGi configuration as shown in Example 10.1, “Specifying a Broker's Template XML Configuration”.
Example 10.1. Specifying a Broker's Template XML Configuration
JBossFuse:karaf@root>
config:propset config configFile
- Use the config:propset command to set the required properties.The properties that need to be set will depend on the properties you specified using property place holders in the template XML configuration and the broker's network settings.For information on using config:propset see section "config:propset, propset" in "Console Reference".
- Save the new OSGi configuration using the config:update command.
Once the new OSGi configuration is saved the new broker instance will start.
Note
If you want to simply deploy a second broker that uses the default configuration template skip Step 1. You will need set the config property to
${karaf.base}/etc/broker.xml
. You will also need to provide values for the data property, the broker-name property, and the openwire-port property.
Example
If you wanted to deploy a new instance of the default broker called
myBroker
that stores its data in InstallDir/data/myBroker
and opens a port at 61617, you would do the following:
- Open the JBoss Fuse command console.
- In the JBoss Fuse command console, use the config:edit command to create a new OSGi configuration file:
JBossFuse:karaf@root>
config:edit io.fabric8.mq.fabric.server-myBroker
- Use the config:propset command to associate your template XML configuration with the broker OSGi configuration:
JBossFuse:karaf@root>
config:propset config ${karaf.base}/etc/broker.xml
- Use the config:propset command to specify the new broker's data directory:
JBossFuse:karaf@root>
config:propset data ${karaf.data}/myBroker
- Use the config:propset command to specify the new broker's name:
JBossFuse:karaf@root>
config:propset broker-name myBroker
- Use the config:propset command to specify the new broker's openwire port:
JBossFuse:karaf@root>
config:propset openwire-port 61617
- Save the new OSGi configuration using the config:update command.