Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.

Camel CXF Design

Integrating CXF into Camel

Camel provides a component API , after defined the endpoint URI format, we just need implement the Camel component API by using CXF as a library to create the client and server for camel-cxf component's consumer and producer.

CXFConsumer

CXFConsumer works as the CXF server, so we create the CXF server with the CXFEndpoint which holds the cxf endpoint information such as SEI class, wsdl location, service name and endpoint name etc. You can configure the cxf endpoint according to this schema in spring.
Now we just leverage the CXF's invoker to override the default invoker by setting a CamelInvoker to the ServerFactoryBean.

CXFProducer

CXF Client is used to send out the incoming message from the CXFProducer and pass the response back.
To support the client which just sends the stream request , we write the CxfClient and CxfClientFactoryBean.

DataFormat

camel-cxf component supports to handle the CXF message with different DataFormat.

To get the best reuse of the CXF generic message layer, we use the CXF feature API to setup the interceptors for different types message handling.

if (!dataFormat.equals(DataFormat.POJO)...) {
   List<AbstractFeature> features = new ArrayList<AbstractFeature>();
   // adding the logging feature here for debug
   features.add(new LoggingFeature());

   if (dataFormat.equals(DataFormat.PAYLOAD)) {
       features.add(new PayLoadDataFormatFeature());       
   }
   
   if (dataFormat.equals(DataFormat.MESSAGE)) {
       features.add(new MessageDataFormatFeature());
   }
   
  // set the feature to the ServerFactoryBean or ClientFactoryBean 
  ...
}

Integrate Camel into CXF

Currently , we introduce Camel Transport for CXF to integrate the Camel as an transport library in CXF.

Binding the conduit and destination with the context endpoint

As CXF transport API side, CXF transport API includes Conduit and Destination that we need to implement with Camel.
We use the the CamelTemplate to send out the message for a certain endpoint in the CamelConduit, and bind a consumer process for the CamelDestination.
When you specify the endpoint URI that start with camel in CamelConduit or CamelDestination the endpoint address, Camel transport will bind it to the endpoint which is in the CamelContext.

Here are some examples of configuring the Camel transport.

© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram