How to connect to fabric-based Fuse MQ from JMS clients running outside of Fuse Fabric.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 7 commits behind jboss-fuse-6.2.1.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

MQ-Fabric Client Example

This project shows how to connect to JBoss A-MQ message brokers running in Fuse Fabric from JMS clients running outside of Fuse Fabric (i.e. when the JMS client is not running within a Fabric-enabled Fuse ESB container).

The Getting Started with ActiveMQ project uses broker URL's like this:


which are replaced in this project with values like this (that also handle failover):


In addition to changing the broker URL's, two other changes are needed to support fabric discovery: a zookeeper.url System property needs to be set in the environment, and a few Fabric libraries must be added to the classpath.

Setting the zookeeper.url

On a typical developer machine, with Fuse Management Console running locally, the zookeeper.url System property should be set to the URL of the Fuse Fabric's Zookeeper instance, which defaults to localhost:2181. One can simply append the property to the startup command line like this:


or add the following to the Maven profile configuration, as is done in this project.


When a distributed Fabric Registry is used (i.e. a Zookeeper ensemble) the zookeeper.url property should be set to a comma delimited list, like this:


Adding the Fabric libraries

These are the dependencies added to the Maven project to support the fabric discovery protocol (see the pom.xml for version info):


Setup the examples against a fabric-based network of brokers

Start a fabric-based network of fault-tolerant (master/slave) brokers. For instructions on how to configure and deploy such a network, see the

This configuration features two broker groups networked together, named "amq-east" and "amq-west", each of which is comprised of a master/slave pair (four brokers total). Consumers will connect to the active broker in the "amq-west" group; producers to the active broker in the "amq-east" group, insuring that messages flow across the network. After the example is up and running, one can kill either or both of the active brokers and observe continued message flow across the network.

Running the examples

Follow the instructions in the various consumer and producer paired example modules:

  • simple-consumer and simple-producer
  • camel-consumer and camel-producer