ServiceMix Camel

The servicemix-camel component provides support for using Apache Camel to provide a full set of Enterprise Integration Patterns and flexible routing and transformation in both Java code or Spring XML to route services on the Normalized Message Router.

For more background you might wanna see the comparison of ServiceMix EIP and Camel or how Camel works with JBI endpoints.

Maven Archetype

You can create a Camel service unit using servicemix-camel-service-unit maven archetype:

mvn archetype:create \
  -DarchetypeGroupId=org.apache.servicemix.tooling \
  -DarchetypeArtifactId=servicemix-camel-service-unit \
  -DarchetypeVersion=2010.01 \
  -DgroupId=your.group.id \
  -DartifactId=your.artifact.id \
  -Dversion=your-version

Once you've customized the service unit, simply install the SU:

mvn install

Remember that to be deployable in ServiceMix, the ServiceUnit has to be embedded in a Service Assembly: only the Service Assembly zip file can be deployed in ServiceMix.
To add your SU in a SA, you need to define it in the dependency sets:

<dependency>
  <groupId>your.group.id</groupId>
  <artifactId>your.artifact.id</artifactId>
  <version>your-version</version>
</dependency>

Endpoint Configuration

The Camel configuration is defined in a camel-context.xml file:

<beans>
  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
      <from uri="jbi:A" />
      <to uri="jbi:B" />
    </route>
  </camelContext>
</beans>

Example

There is an example in the samples area which creates a Camel Service Unit and puts it into a Service Assembly for deploying a some Camel routes and EIP patterns in JBI.

You can find the example in the servicemix/samples/camel area.

For more details see the Camel Example.

Cookbook recipes

See Also

  • No labels