LibraryLink ToToggle FramesPrintFeedback

Chapter 1. Introduction to the Fuse ESB JMS Binding Component

The Fuse ESB JMS binding component is built using the Spring 2.0 JMS framework. It allows you to create two types of endpoints:


The JMS binding component also supports non-Spring based endpoints. However, the non-Spring based endpoints are deprecated.

In most instances, you do not need to write any Java code to create endpoints. All of the configuration is done using Spring XML that is placed in an xbean.xml file. There are some instances where you will need to develop your own Java classes to supplement the basic functionality provided by the binding components default implementations. These cases are discussed at the end of this guide.

The Fuse ESB JMS binding component provides a number of enterprise quality features including:

A service unit that configures the JMS binding component will contain two artifacts:


The xbean.xml file contains the XML configuration for the endpoint defined by the service unit. The contents of this file are the focus of this guide.


The service unit can define more than one endpoint.


The jbi.xml file is the JBI descriptor for the service unit. Example 1.1 shows a JBI descriptor for a JMS service unit.

Example 1.1. JBI Descriptor for a JMS Service Unit

<jbi xmlns="" version="1.0">
  <services binding-component="false" 1
            xmlns:b=""> 2
    <provides service-name="b:jms" 3
              endpoint-name="endpoint"/> 4
    <consumes interface-name="b:MyConsumerInterface"/>  5

The elements shown in Example 1.1 do the following:


The service element is the root element of all service unit descriptors. The value of the binding-component attribute is always false.


The service element contains namespace references for all of the namespaces defined in the xbean.xml file's bean element.


The provides element corresponds to a JMS provider endpoint. The service-name attribute derives its value from the service attribute in the JMS provider's configuration.


This attribute can also appear on a consumes element.


The endpoint-name attribute derives its value from the endpoint attribute in the JMS provider's configuration.


This attribute can also appear on a consumes element.


The consumes element corresponds to a JMS consumer endpoint. The interface-name attribute derives its value from the interfaceName attribute in the JMS consumer's configuration.


This attribute can also appear on a provides element.

The Fuse ESB Maven tooling provides two archetypes for seeding a project whose result is a service unit for the JMS binding component:

The resulting project will contain two generated artifacts:

If you want to add custom marshalers, custom destination choosers, or other custom Java code, you must add a java folder to the generated src folder. You also need to modify the generated pom.xml file to compile the code and package it with the service unit.

To package JMS endpoints as OSGi bundles you need to make two minor changes:


When you deploy JMS endpoints in an OSGi bundle, the resulting endpoints are deployed as a JBI service unit.

For more information on using the OSGi packaging see Appendix D.

The elements used to configure JMS endpoints are defined in the namespace. You will need to add a namespace declaration similar to the one in Example 1.2 to your xbeans.xml file's beans element.

In addition, you need to add the schema location to the Spring beans element's xsi:schemaLocation as shown in Example 1.3.