JBoss Fuse

Introduction to Fabric integration platform

This is a quickstart guide to fabric8 which is an open source integration platform for managing Java Containers. You will learn how it can be used to provision, automate and configure containers from a central location with a consistent UI.

Fabric is integrated into JBoss Fuse 6.1, therefore in order to use it, this is the list of tools you will need to install:

  • JBoss Fuse 6.1 or newer
  • Maven

Follow this tutorial Helloworld Fuse tutorial to learn how to get started with JBoss Fuse

Once installed, if you have not already done so, create one (or more users) by adding a line of the following form to the Fuse-install-dir/etc/users.properties file:


Now start Fuse, executing from the shell:

$ fuse

Now we will create a fabric, using the password we have defined for the admin user. From the Karaf shell enter:

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

Still from the Karaf shell, invoke the fabric:container-list command to see a list of all containers in your new fabric. You should see a listing something like this:

JBossFuse:karaf@root>  fabric:container-list
[id]                           [version] [connected] [profiles] [provision status]
root*                          1.0       true        fabric, fabric-ensemble-000
0-1, jboss-fuse-full, success

Create the Camel Blueprint project

Ok, now we will create a Maven project based on Camel archetype blue-printfabric tutorial integration jboss fuse

This Archetype will create an project based on a Camel Spring Route. First of all, we need to apply some changes to the pom.xml of this project in order to be able to deploy it to Fabric (see highlighted sections):

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">



	<name>A Camel Spring Route</name>

		<fabric8.features>camel camel-cxf</fabric8.features>


		<!-- logging -->

		<!-- testing -->



			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> 
				<version>2.5.1</version> <configuration> <source>1.6</source> <target>1.6</target> 
				</configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> 
				<artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <configuration> 
				<encoding>UTF-8</encoding> </configuration> </plugin> -->

			<!-- allows the route to be ran via 'mvn camel:run' -->




Basically we need to specify that the project will generate a bundle, we need commenting some plugins to avoid conflicts with the build phase of the project and include the maven-bundle-plugin the fabric8-maven-plugin.

You might think of a bundle like a big collection of classes (e.g., project code, dependencies, and the class path).

Finally, let's choose some absolute paths for our Camel route. The Camel context is defined into the src/main/resources/META-INF/spring/camel-context.xml file:

<beans xmlns="http://www.springframework.org/schema/beans"
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

	   <camelContext xmlns="http://camel.apache.org/schema/spring">
<route xmlns="http://camel.apache.org/schema/spring" id="route1">
        <from uri="file:D:\\camel\\in?noop=true"/>
                <xpath>/person/city = 'London'</xpath>
                <log message="UK message"/>
                <to uri="file:D:\\camel\\out\\uk"/>
                <log message="Other message"/>
                <to uri="file:D:\\camel\\out\\others"/>


Done with the project it's now time to Package and deploy the project on Fabric.

Packaging the Project and deploying it on Fabric

In order to be able to use the fabric8-maven-plugin you need to include the fabric's repository user and password into Maven's settings.xml file:


Next, execute the following Maven goals to package the project:

mvn clean install

Finally, deploy the project on Fabric with:

mvn fabric:deploy

Your Project should be deployed into Fabric, launch the hawtio Web console at http://localhost:8181 and enter the admin/admin credentials.

Configuring a Child Container on Fabric

Select the Fabric perspective and click on the Runtime upper Tab. The list of available containers should appear:

fabric 8 tutorial fuse example

Click on the +Create button to create a child container where we will deploy our project as a Profile.

fabric 8 tutorial fuse example

In the "Create New Container" window select the fabric8demo profile and the jboss-fuse-full profile. In the right side of the screen enter a name for the Container and the admin/admin credentials.

fabric 8 tutorial fuse example

Now the admin Container should be visible and running. Clicking on the child container (admin) will take you to the following screen:

fabric 8 tutorial fuse example fabric8

Check the fabric8demo profile and click on the Open button. You will be taked into the Container's perspective which, being based on Camel, contains a Camel upper tab. Click on it to see the available Camel Contexts:

fabric tutorial fuse jboss

From there you can have a look at the Source code of your Camel route, Debug your Route or see from the Diagram window the list of messages which have been routed by our File component.

fabric 8 tutorial fuse example fabric8

If you have placed the message1.xml and message2.xml files which are part of the Maven project in the correct folders, and the Route has started, you will see that messages are moved from the "In" folder to the "Out" folder based on the content of the file.

Check out the Logs tab to see that Camel route is consuming messages.

2015-04-04 23:09:56 INFOorg.apache.camel.osgi.OsgiSpringCamelContext Route: route1 started and consuming from: Endpoint[file:D:\\camel\\in?noop=true]
2015-04-04 23:09:56 INFOorg.apache.camel.osgi.OsgiSpringCamelContext Total 1 routes, of which 1 is started.


Follow us on Twitter