Monday, 11 November 2013

Getting started with Fuse

For my first blog post I wanted to do a small brain dump of links that I've found useful when working with Fuse.  Fuse is made up of a number of Apache projects which can feel a bit overwhelming when starting out.  It's the same with learning anything new, half the battle is knowing where to find help.  Well the good news is there is a wealth of information available that will support the novice right through to the expert.

Get the product

Download the distributions from here

There is a huge amount of information on the RedHat sites.  Even if you think you know the products I highly recommend reviewing these as the documentation is improved from version to version.

Recommended Reading

The transition from J2EE application servers to working with OSGi is something that developers can struggle with.  Combine that with understanding the different error handling options in Camel and configurations for ActiveMQ, starting out can be time consuming.  For this reason and many more as you will find out, I highly recommend the following books.

ActiveMQ in Action
Camel In Action
Enterprise OSGi InAction
Instant Apache Camel Message Routing

An essential reference book that all development teams and architects should have access to is Enterprise Integration Patterns.

Where to start


A great way to start development is by using an archetype, I normally start with the camel-blueprint but there are many others.

$ mvn archetype:generate -Dfilter=camel

You will need to point Maven to the repo

Once you have your bundle you will want to deploy it.  The archetype mentioned above will use maven plugins described below to build you a bundle.  Once you have build it using $ mvn install the artifact will reside in your local .m2 directory.  Fuse by default knows about this location so you are now able to instruct Fuse to install your bundle.  There is a readme that will explain all this and the steps you should take.  Very quickly you should be able to have a running bundle in Fuse.


There are a number of quickstarts that get overlooked in the Fuse distribution.  These quickstarts cover general EIPs, WebServices, JMS and error handling.  There is also the FuseByExample GitHib repository.

Where to find help

I've broken down the core components that make up the Fuse distribution...

Camel - Integration framework and implementation of the EIP book mentioned above.  For me the best way to understand how a camel component works is to look at the unit tests.  All code can be cloned from GitHub.

ActiveMQ - The message broker and backbone of the ESB.

CXF - WebService implementation in Fuse.

Karaf OSGi runtime and console.  There are also a number of Maven plugins that help with the generation of offline repositories and describing features for provisioning.  These plugins can work together to enable Continuous Delivery.  More on this in a future post.

Generating offline repositories
Creating features

Felix Apache Implementation of the OSGi spec

The following plugin is essential to building OSGi bundles that can be easily described in a feature or deployed directly into Karaf.  There is a lot of information here and its extremely useful.  If you have a number on non OSGi-ified bundles that you need to deploy and encapsulate then look at building an uber jar using the embed dependency option in this plugin.  This style is used to wrap these non OSGi bundles, expose their packages to the uber bundle classpath and control what is exported or registered services.

Maven bundle plugin

Aries / Blueprint -  Implementation of the Enterprise OSGi spec including Web container, Transaction, JNDI and JPA.

Dependency injection in Fuse
Camel route testing

Fabric - This is my personal favourite component of Fuse.  Being able to manage all configurations, containers, logs, features and brokers backed by a highly available distributed registry using command line, scripts or hawt web consoles is pretty cool.

View Docs - Fuse
Deploying into the container

Hawtio - What happens inside an ESB?  This is sometimes the hardest area when adopting a new technology, enabling and empowering developers, test and support teams.  From JBoss Fuse 6.0 there is a new webconsole called hawtio.  The aim is to consolidate the various consoles available to manage queues, configuration, view logs, camel routes trace / debug messages and much more.  With 6.1 hawtio also includes the Fuse Management Console and ties into Fabric.  This now provides us with the ability to search across our entire Fabric (cluster)

Demo link from the hawtio site


If you're struggling and considering that workaround that you know you will be ridiculed for then ask the community.  This is one of the main reasons that Fuse is such an awesome technology... because it's backed by a community that wants to help others.

JBoss Fuse
Camel mailing list 
Search the old Fusesource website


This is a great way to communicate and interact with the communities.  Below are a list of channels that are useful.

No comments:

Post a Comment