[[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
xref:{eip-vc}:eips:enterprise-integration-patterns.adoc[Enterprise Integration
Patterns] and can be used outside of JBI (e.g. just with pure
xref:components::jms-component.adoc[JMS] or xref:components::mina-component.adoc[MINA]). Also Camel supports a
xref:ROOT:dsl.adoc[Java DSL] or xref:ROOT: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");
----

