Please obtain a copy of JBoss A-MQ by going to
and download JBoss A-MQ from Red Hat.
Here are the summary steps to create.
1. Unzip to install
2. Create User
3. Startup A-MQ server
4. Create Fabric
5. Create A-MQ broker profile
6. Create the container
7. Create a new version and apply AMQP Setting
8. Container version rolling upgrade
9. Test it.
To install simply unzip the jboss-a-mq-version.redhat-x.zip file to a directory.
Before starting up JBoss A-MQ, we need to set a default user.
Open up $A-MQ_INSTALLATION_PATH/etc/users.properties
Remove the # before admin=admin,admin
Go to $A-MQ_INSTALLATION_PATH/bin , startup A-MQ by executing
Because we are going to manage brokers from Fabric,
create the fabric with this command
There are two different ways to create MQ broker, we can create one using Hawtio GUI or by command. I am going to show you the command part first in the tutorial.
mq-create --group demo mybroker
This creates a A-MQ profile called mybroker, that belongs to a group called demo
Type profile-list or profile-list | grep mybroker to see if the profile has been successfully created.
Add broker settings to mq-broker-demo.mybroker profile by typing
profile-edit --resource broker.xml mq-broker-demo.mybroker
and paste the following content into the file, save.
you should be able to see the new resource added by checking with
Now the profile is ready, we are going to create 3 containers (instances) that will run this messaging profile.
container-create-child --profile mq-broker-demo.mybroker root demoContainer2
container-create-child --profile mq-broker-demo.mybroker root demoContainer3
All 3 container should startup automatically, you can check if it correctly install by listing all the containers:
Now, you have successfully create a clusters of A-MQ broker with Master-Slave topology. But it still doesn't run AMQP yet.
I want to show you how to do version upgrades,
Create version 1.1
Add AMQP connector to the 1.1 version of our profile mq-broker-demo.mybroker
profile-edit --resource broker.xml mq-broker-demo.mybroker 1.1
add the amqp connect in the transportConnectors section of xml.
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672"/>
Last part of setting, we need to upgrade the containers to our updated version 1.1
fabric:container-upgrade 1.1 demoContainer1
And do the rest,
fabric:container-upgrade 1.1 demoContainer2
fabric:container-upgrade 1.1 demoContainer3
git clone https://github.com/FuseByExample/activemq-amqp-example.git
activemq-amqp-example/src/main/resources/jndi.properties change the connectionfactory.myJmsFactory setting to
Test AMQP by running consumer, under activemq-amqp-example/ directory,
mvn -P consumer
And startup Producer to test
mvn -P producer
You should see the consumer picking up the message created by the producer.