| [[HowdoestheCamelAPIcompareto-HowdoestheCamelAPIcomparetofromCXFHTTPJBIJMSJavaMailetc]] |
| = How does the Camel API compare to from CXF, HTTP, JBI, JMS, JavaMail, etc. |
| |
| We have tried to make the Camel |
| http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html[Exchange] |
| and |
| http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Message.html[Message] |
| map very closely to JBI in particular but also |
| xref:components::cxf-component.adoc[CXF], xref:components::http-component.adoc[HTTP], xref:components::jms-component.adoc[JMS], |
| xref:components::mail-component.adoc[Mail], xref:components::xmpp-component.adoc[XMPP] and most other integration |
| abstractions. We want to prevent leaky abstractions, so the Camel API |
| exposes the underlying APIs so that a xref:processor.adoc[Processor] can |
| make use of the underlying abstractions if they make sense. |
| |
| For example: |
| |
| [width="100%",cols="50%,50%",options="header",] |
| |======================================================================= |
| |Component |Inbound exchange exposes |
| |xref:components::cxf-component.adoc[CXF] |Each Inbound |
| http://camel.apache.org/maven/current/camel-cxf/apidocs/org/apache/camel/component/cxf/CxfExchange.html[CxfExchange] |
| has access to the underlying Exchange and Message from CXF |
| |
| |xref:components::http-component.adoc[HTTP] |Each inbound |
| http://camel.apache.org/maven/current/camel-http/apidocs/org/apache/camel/component/http/HttpExchange.html[HttpExchange] |
| has access to the underlying HttpServletRequest and HttpServletResponse |
| |
| |JBI |Each inbound |
| http://camel.apache.org/maven/current/camel-jbi/apidocs/org/apache/camel/component/jbi/JbiExchange.html[JbiExchange] |
| has access to the underlying JBI MessageExchange and NormalizedMessage |
| objects |
| |
| |xref:components::jms-component.adoc[JMS] |Each inbound |
| http://camel.apache.org/maven/current/camel-jms/apidocs/org/apache/camel/component/jms/JmsExchange.html[JmsExchange] |
| has access to the underlying JMS Message objects |
| |======================================================================= |
| |
| You can probably see a pattern forming now :smile: |
| |
| For many routing and mediation components and |
| xref:processor.adoc[Processor] objects, you maybe don't care about the |
| underlying transport and can instead stick to the abstract Camel API. |
| But if you need to, the real transport APIs are there for you. |