Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Providing a new physical protocol not yet supported by CXF (udp or ftp, for example). Some of such cases can be solved using integration with corresponded Camel component, but if it is not appropriate or Camel component for physical transport is also missing - let think about new custom CXF transport.
  2. Supporting tightly integration with another framework (like JBI or Camel). In this case integration is transparent for CXF applications - they just speak directly with target framework on the transport level. Transport implementation is responsible for converting and transferring CXF exchange, messages and faults to target framework.

Presently the CXF 2.3.x distribution provides a transport implementation for the following protocols: HTTP(S), JBI, JMS and Local(inside one JVM). Camel additionally implements CXF transport for Camel exchanges.

Architecture and Design

The transport functionality is based on two fundamental definitions: conduit and destination. Conduits are responsible for sending a message to recipients and destinations for receiving a message from the sender. In order to send a response, a destination needs its own back-channel conduit (in case of request-response communication). Conduits and destinations are created by a TransportFactory. CXF selects the correct TransportFactory based on the transport URL. SOAP is also considered a high level transport and has its own conduit and destination in CXF.
To send a message into a physical channel, the conduit should access the message context. Normal practice in this case is to use a subclass of OutputStream extending CachedOutputStream. The custom stream will be fed the message and provides a possibility to access context in streaming or buffered form depending on the transport requirements. CachedOutputStream is configured to keep message in memory only up to a predefined size. If this size is exceeded, the message is swapped to disk.

...

Conduit and destination objects can by concurrently accessed by multiple threads. Implementations should care about concurrent correlations maps and/or synchronization primitives.

References

CXF transport implementations: package org.apache.cxf.transport.*

...