Skip to main content

Red Hat JBoss Fuse - Sending message to queue in ActiveMQ via Camel

We will need to install 3 softwares before hand.

A. Fuse
B. FuseIDE
C. Maven

To get JBoss Fuse, logon to JBoss Customer Portal, download the beta version. Or Visit the .

Unzip the file to install JBoss Fuse. (A best practice for installing the software is not to have space or any special characters in the path)

open up file under $FUSE_INSTALLATION_PATH/etc
by taking out # before admin setting, we have create a user admin, with password admin that has the right of an administrator.

Fuse IDE is the development tool, it's very helpful, it has various examples for you to get started. So we download it from JBoss Customer Portal, or Visit the for it.  Depends on your own operating system, download the version that apply to you.

Install the IDE by choosing the installation path and basically just click next, next to complete the installation.

Another must have to do this demo is maven. I am sure almost everyone has it now. I will explain and show why we needed it later.

For this demo, there are 2 major step.

A.For the running environment, we are going to setup a Fabric management environment with JBoss Fuse. Create and start a ActiveMQ broker (Master-Slave), so we can put message into the queue using Camel. And create a container called "demo" for running the camel route.
B. Create a Camel Project. Within the project we are going to create 2 routes.
  1. Sends a message into a queue called "demo" every 5 secs.
  2. Listen on the demo queue, as soon as it receives message, print it out.

1.Go to $FUSE_INSTALLATION_PATH/bin,run ./fuse (For Windows run fuse.bat) After fuse got started, create a fabric management enviorment by type in the following command.

JBossFuse:karaf@root> fabric:create --zookeeper-password admin 

2. To access the new management console for JBoss Fuse 6.1 . Access http://localhost:8181 in your browser . Logon with admin/admin (ID/PWD)。

After logon, checkout the top right had corner, choose Fabric under Container.

3. Click MQ on the top menu, you will be able to see the embedded broker for this root container. But we are not going to use this one. What we are going to do is to setup a ActiveMQ Broker to handle the messaging.

Name the Broker : "demoBroker", choose MasterSlave as the backup strategy. And Click on the Create Broker. 

Since only the config of the broker has been created, you will see 0 and red show on the screen for our demoBroker. Click on the number "0" to create containers to run it.

Everything is very straight forward to create a container. Set container's name and because we choose MasterSlave that has minimum number of 2 instance, therefore we will create 2 containers here.

2 containers are created. 

To view the detail of each container, click on the icon on the right-hand side of the container.

Under ActiveMQ, All the details of the broker will be shown on the right-hand side of the console. Look for "Open wire url" as we are going to need later.

4. In your FUSE IDE, create a Fuse Project .

One of the great thing about FUSE IDE, is that you don't need to find all the dependency on your own, many sample archetype are ready done for you to reference it!  Choose activemq for this demo.

Group ID: org.blogdemo 
Artifact ID: camel-amq

delete the default example, we are going to create a new one.

Under src/main/resources/META-INF/spring , create a Camel XML file.

5.  Configure the ActiveMQ broker URL we previously get from the console on ActiveMQComponent. And don't forget also to put in the ID/PWD.


6.To create the first route,

Set an endpoint by dragging it on to the canvas.

By using a camel component timer, we can set this route to be executed in every 5 sec.

Drag a log component on to the canvas.

Click the log component on the canvas, you will be able to enter the log message in the properties tag below.

Under Transformation, drag setBody component into canvas. This sets the message to send into the queue.

Drag another log component to log the message content by setting the following content below.
printing body => ${body}

Create another endpoint pointing to the queue. Set the Uri to activemq:queue:demo

the activemq:queue:demo looks quite familiar? Yes, it's the bean that we set at the very beginning of camel config xml.

Connect all the components together by dragging the arrow from one component to the next one.

Save. We have completed the first route.

7. Right click on the xml file, select Run AS -> Local Camel Context (Without tests) to run the xml.

You will be able to see the content we set in the log.

The camel xml is as follows: (Please not the port is depended your activemq open wire URI)


8. Next step is to create the second route. This one is much easier. It simple listen to the demo queue. and print every message that sent into it.

Again, go to src/main/resources/META-INF/spring and create another Camel XML file.

name : camelListener.xml 

Add the Broker bean and it's URL and ID/PWD into camelListener.xml.

Drag Endpoint to canvas, under Properties -> Detail set the uri to activemq:queue:demo so this endpoint will listen to the queue that data was sent.

Add log to print out the content of the message received. Set the following to the message.
msg body => ${body}

Connect both components together by dragging the arrow from first component to the second one.

Done, and remember to save.

The whole Camel xml is as follows.


9. Right click on the camelListner.xml file, select Run AS -> Local Camel Context (Without tests) to run the xml.

You will be able to see the message we sent to the queue from log.

10. Deploying Camel project into fabric. To do this, we are going to build it with maven then deploy on to Profile through maven.

There are several ways to deploy onto Fabric Profile. This time we are going to install as a OSGi Bundle. For that, please replace your current pom.xml to following pom.xml.



  A Camel Spring Route


      FuseSource Release Repository
      FuseSource Snapshot Repository

      FuseSource Release Repository
      FuseSource Snapshot Repository









For pom.xml nothing much has changed, only we ask it to package as a bundle.


And add the bundle plugin. 


Go to the project directory, execute mvn clean install

11. In Fuse prompt add a profile blogdemoP
JBossFuse:karaf@root> profile-create blogdemoP

Deploy the camel-amq project we just created onto the Profile via maven.
JBossFuse:karaf@root> profile-edit -b mvn:org.blogdemo/camel-amq/1.0.0-SNAPSHOT blogdemoP

12. We are going to create a container in Fuse Console.  Then add the profile we just created onto the container.  Click on "+Container".
Name the new container : demo, on the button left corner, add full profile.

Add blogdemoP Profile too. Then click on "Create And Start Container"
在左邊下方,安裝剛剛建立的blogdemoP Profile, 然後按下左上方的 "Create And Start Container"

After demo container started, click on the detail icon on the right hand side.

A Popup window or tab will display the status and config of the chosen container. Click on Logs to see what's going on.

That's all.

In the Fuse Console,

In the demo container ,Click on Camel,  with left menu Routes -> Attributes you can see how many times the route has been executed.

Click on the route if you want to see more specific details on the route. Like how many times each component has been executed.

As with the Diagram Tab, It will display all the endpoint and route in a very grasphical way.

Configuration of each route can be seen by clicking on the route on the diagram itself.

ActiveMQ details are also shown on the console. Go to Master Broker's container detail by clicking on the icon. 

On the left-hand menu choose queue, under Attributes, you will able see the stats on each queue.


Irfan Siddique said…
Hi Cristina.

Very very good Tutorial.

I am getting this error.

rovision Exception:

org.osgi.service.resolver.ResolutionException: Unable to resolve dummy/0.0.0: missing requirement [dummy/0.0.0] osgi.identity; osgi.identity=org.blogdemo.camel-AMQ; type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]" [caused by: Unable to resolve org.blogdemo.camel-AMQ/1.0.0.SNAPSHOT: missing requirement [org.blogdemo.camel-AMQ/1.0.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.camel)(version>=2.15.0)(!(version>=3.0.0)))"]

at org.apache.felix.resolver.Candidates.populateResource(

at org.apache.felix.resolver.Candidates.populate(

at org.apache.felix.resolver.ResolverImpl.resolve(

at io.fabric8.agent.DeploymentBuilder.resolve(

at io.fabric8.agent.DeploymentAgent.doUpdate(

at io.fabric8.agent.DeploymentAgent$

at java.util.concurrent.Executors$


at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$


Please help.


Kind Regards
Irfan Siddique
Christina Lin said…
Hi Irfan,

I think you left out the part where I added a "full" profile in the container. :)
Irfan Siddique said…
Hi Cristina.

I ogt the problem. It was wrong version of Apache Camel. Jboss fuse use 2.12.0 camel version. but my project was with 2.15.0. I changed and it is working fine.


Kind Regards
me said…
Thank you so much for this.

I believe you forgot to mention a step to add a queue to the broker.

Thanks once again!
bhavin shah said…
Hi Christian,

I am using Fuse 6.2. Issue I am having is in step 12. When I create Container with Full profile then it creates new Openwire Url endpoint as compared to the OpenWire Url values in our Route after we create the Broker.

I am still getting my head around Fuse and OSGI, would it make sense to use the profile of our Route in the Broker Container.

Please let me know.



Popular posts from this blog

Red Hat JBoss Fuse - Getting Started with Fuse Integration Service 2.0 Tech preview

I just realized that I did not do a getting started for Fuse Integration Service 2.0 Tech preview before I did the pipeline demo, thanks for those of you who reminded me! :)

To get started with FIS 2.0, for people who has just getting to know the technology, here is how I interpret it. Basically, it's divide into two aspect,

1. Integration development, FIS uses Apache Camel as the core technology that creates, orchestrate, compose microservices into a super lightweight thin integration layer, and become the API provider and service orchestrator through exposing RESTful or messaging service endpoints. And you can choose to either package and run it with Spring-Boot or Karaf.

2. Application Deployment and Management, FIS takes advantages of OpenShift platform, and allows you to separately deploy the micro-integration service among distributed environment, at the same time takes care of the failover, high availability, load balancing and service lookup problem for you.

So, now we know …

Red Hat JBoss Fuse/A-MQ - Fuse and A-MQ Version 6.3 GA is released!

Fuse and A-MQ 6.3 GA has just went out. Maybe, you would think this is just only a minor version release why should I care? Hold your thoughts on that! Because they have done a lot of improvements and also added many new features into this release.

Besides various bug fixes and making sure Fuse Fabric is much more stable. There are two major change in this version update:

New Tooling in JBoss Developer Studio (JBDS) 9.1 GA. Newer Apache Camel version – Camel v2.17. I was really impressed by the work put in to make developing Camel application much simpler. First is the installation of tooling itself. Now it has a all-in-one installer so you don't need to worry about which plugins you need to check. See the videos below to see the new "Getting Started" of Fuse 6.3.

And If you notice from the above video, the presentation of camel route in JBDS has also updated. It fixed some of the miss representation of logic and making it easier to read.

Old Camel Route
New Camel Route
On …

Fuse Integration Service - Setup JBDS and create first quickstart application

Before we go and start creating our first application, I want to show you how to setup your JBoss Developer Studio, create a small application from the quickstart example and then running it on Fuse Integration Service.

I am using JBoss Developer Studio version 9, you can find it here.
After download the

double-click it, and start installing with default values.

After successful installation, we will need install the plugins for Fuse, on JBoss Central view, select software update, select enable early access.

And select JBoss Fuse Development for the plugin,

Click on install, and we are all set to go!

First thing first, we want to create a Fuse project to deploy on the base of Fuse Integration Service, which is OpenShift. If you have not installed it, please go back to my previous post for instructions. So on your JBDS, right click and start creating the project. Select new, maven project, if you have installed the plugin correctly, you should …