Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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 from Java code or Spring XML to route services on the Normalized Message Router via EIP..

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 You can get started using the Maven Archetypes, in particular the servicemix-camel-service-unit maven archetype:

Code Block

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:

Code Block

mvn install
Info

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:

Code Block

<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:

Code Block
xml
xml

<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.

...

For more details see the Camel Example.

Cookbook recipes

Children Display
pageservicemix-camel cookbook
excerpttrue

See Also