[[HowdoesCamelcomparetoServiceMixEIP-HowdoesCamelcomparetoServiceMixEIP]]
=== How does Camel compare to ServiceMix EIP

http://servicemix.apache.org/servicemix-eip.html[ServiceMix EIP] was the
ancestor though they both do similar things.

The main difference with ServiceMix EIP is its integrated into the
existing ServiceMix XBean XML configuration whereas Camel has more
link:../enterprise-integration-patterns.adoc[Enterprise Integration
Patterns] and can be used outside of JBI (e.g. just with pure
<<jms-component,JMS>> or <<mina-component,MINA>>). Also Camel supports a
link:../dsl.adoc[Java DSL] or link:../spring.adoc[XML configuration].

[[HowdoesCamelcomparetoServiceMixEIP-ConvertingfromServiceMixEIPtoCamel]]
==== Converting from ServiceMix EIP to Camel

Here's an example of a servicemix-eip route:

[source,xml]
----
<eip:message-filter service="test:messageFilter" endpoint="endpoint">
  <eip:target>
    <eip:exchange-target service="test:trace3" />
  </eip:target>
  <eip:filter>
    <eip:xpath-predicate xpath="count(/test:world) = 1" namespaceContext="#nsContext"/>
  </eip:filter>
</eip:message-filter>
----

Here's the equivalent Camel code in XML:

[source,xml]
----
<route>
  <from uri="jbi:endpoint:test:messageFilter:endpoint">
  <filter>
   <xpath>count(/test:world) = 1</xpath>
   <to uri="jbi:service:test:trace3"/>
  </filter>
</route>
----

Or Java:

[source,java]
----
from("jbi:endpoint:test:messageFilter:endpoint").
  filter(ns.xpath("count(/test:world) = 1")).
  to("jbi:service:test:trace3");
----

[[HowdoesCamelcomparetoServiceMixEIP-SeeAlso]]
==== See Also

* link:how-does-camel-work-with-servicemix.adoc[How does Camel work with
ServiceMix]
* link:how-does-camel-compare-to-servicemix.adoc[How does Camel compare
to ServiceMix]
* http://incubator.apache.org/servicemix/servicemix-camel.html[ServiceMix
Camel plugin]
