Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Appendix A. Migrating from ServiceMix EIP


If you are currently an Apache ServiceMix 3.x user, you might already have implemented some Enterprise Integration Patterns using the ServiceMix EIP module. It is recommended that you migrate these legacy patterns to Apache Camel, which has more extensive support for Enterprise Integration Patterns. After migrating, you can deploy your patterns into a Red Hat JBoss Fuse container.

A.1. Migrating Endpoints


A typical ServiceMix EIP route exposes a service that consumes exchanges from the NMR. The route also defines one or more target destinations, to which exchanges are sent. In the Apache Camel environment, the exposed ServiceMix service maps to a consumer endpoint and the ServiceMix target destinations map to producer endpoints. The Apache Camel consumer endpoints and producer endpoints are both defined using endpoint URIs.
When migrating endpoints from ServiceMix EIP to Apache Camel, you must express the ServiceMix services/endpoints as Apache Camel endpoint URIs. You can adopt one of the following approaches:
  • Connect to an existing ServiceMix service/endpoint through the ServiceMix Camel module (which integrates Apache Camel with the NMR).
  • If the existing ServiceMix service/endpoint represents a ServiceMix binding component, you can replace the ServiceMix binding component with an equivalent Apache Camel component (thus bypassing the NMR).

The ServiceMix Camel module

The integration between Apache Camel and ServiceMix is provided by the servicemix-camel module. This module is provided with ServiceMix, but actually implements a plug-in for the Apache Camel product: the JBI component (see and JBI Component).
To access the JBI component from Apache Camel, make sure that the servicemix-camel JAR file is included on your Classpath or, if you are using Maven, include a dependency on the servicemix-camel artifact in your project POM. You can then access the JBI component by defining Apache Camel endpoint URIs with the jbi: component prefix.

Translating ServiceMix URIs into Apache Camel endpoint URIs

ServiceMix defines a flexible format for defining URIs, which is described in detail in ServiceMix URIs. To translate a ServiceMix URI into a Apache Camel endpoint URI, perform the following steps:
  1. If the ServiceMix URI contains a namespace prefix, replace the prefix by its corresponding namespace.
    For example, after modifying the ServiceMix URI, service:test:messageFilter, where test corresponds to the namespace,, you get service:
  2. Modify the separator character, depending on what kind of namespace appears in the URI:
    • If the namespace starts with http://, use the / character as the separator between namespace, service name, and endpoint name (if present).
      For example, the URI, service:, would be modified to service:
    • If the namespace starts with urn:, use the : character as the separator between namespace, service name, and endpoint name (if present).
      For example, service:urn:progress:com:demos:test:messageFilter.
  3. Create a JBI endpoint URI by adding the jbi: prefix.
    For example, jbi:service:

Example of mapping ServiceMix URIs

For example, consider the following configuration of the static recipient list pattern in ServiceMix EIP. The eip:exchange-target elements define some targets using the ServiceMix URI format.
<beans xmlns:sm=""
       xmlns:test="" >
    <eip:static-recipient-list service="test:recipients" endpoint="endpoint">
        <eip:exchange-target uri="service:test:messageFilter" />
        <eip:exchange-target uri="service:test:trace4" />
When the preceding ServiceMix configuration is mapped to an equivalent Apache Camel configuration, you get the following route:
  <from uri="jbi:endpoint:"/>
  <to uri="jbi:service:"/>
  <to uri="jbi:service:"/>

Replacing ServiceMix bindings with Apache Camel components

Instead of using the Apache Camel JBI component to route all your messages through the ServiceMix NMR, you can use one of the many supported Apache Camel components to connect directly to a consumer or a producer endpoint. In particular, when sending messages to an external endpoint, it is more efficient to send the messages directly through a Apache Camel component than sending them through the NMR and a ServiceMix binding.
For details of all the Apache Camel components that are available, see and Apache Camel Components.