...
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.You can get started using the
Maven
...
Maven Archetype
You can create a Camel service unit using 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 |
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
Children Display | ||||||
---|---|---|---|---|---|---|
|
See Also
- Apache Camel
- Camel Example
- Enterprise Integration Patterns
- Using JBI in Camel
- Comparison of ServiceMix EIP and Camel
Using servicemix-camel in embedded mode
This component is both a JBI component and a camel component, which means that when embedding servicemix-camel in a non JBI compliant way (in an embedded ServiceMix configuration for example), the component must be configured in a specific way:
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.
|
Endpoint Configuration
The Camel configuration is defined in a camel-context.xml file:
Code Block | ||||
---|---|---|---|---|
| ||||
<beans>
<camelContext id="camel" xmlns | ||||
Code Block | ||||
| ||||
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://xbean.org/schemas/spring/1.0" xmlns:sm="http://servicemix.apache.org/config/1.0" xmlns:bean="http://servicemix.apache.org/bean/1.0" xmlns:camel="http://activemq.apache.org/camel/schema/spring" xmlns:myproject="http://my.namespace.com/"> <!-- the JBI container --> <sm:container id="jbiContainer" embedded="true"> <route> <sm:components> <ref id<from uri="jbi:A" /> </sm:components> <sm:endpoints> <bean:endpoint service="myproject:tracker" endpoint="tracker" bean="#tracker<to uri="jbi:B" /> </sm:endpoints>route> </sm:container> <bean id="jbi" class="org.apache.servicemix.camel.CamelJbiComponent" /> <camelContext id="camelContext" useJmx="true" xmlns="http://activemq.apache.org/camel/schema/spring"> <package>my.project.routeBuilders</package> </camelContext> </beans> |
...
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
Children Display | ||||
---|---|---|---|---|
|