Versions Compared

Key

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

...

Each of these filters follows a similar pattern of events: receives a message on the incoming pipe, processes the message, and then transmits the updated resulting message on the outgoing pipe. The pipe connects one filter to the next, sending output messages from one filter to the next.

Pipes and Filter using XML DSL:

Code Block
languagexml
<route>
    <from uri="activemq:order"/>
    <to uri="bean:encrypt"/>
    <to uri="bean:authenticate"/>
    <to uri="bean:duplicates"/>
    <to uri="activemq:invoice"/>
</route>

Pipeline for the InOut Exchange Pattern

Normally, all of the endpoints in a pipeline have an input (In message) and an output (Out message), which implies that they are compatible with the InOut message exchange pattern. The pipeline connects the output of each endpoint to the input of the next endpoint. The Out message from the final endpoint is sent back to the original caller. You can define a route for this pipeline, as follows:

Code Block
<camelContext id="buildPipeline" xmlns="http://camel.apache.org/schema/spring">
  <route>
    <from uri="jms:RawOrders"/>
    <to uri="cxf:bean:decrypt"/>
    <to uri="cxf:bean:authenticate"/>
    <to uri="cxf:bean:deDup"/>
    <to uri="jms:CleanOrders"/>
  </route>
</camelContext>

NOTE: There is no dedicated pipeline element in XML DSL format, thus the preceding combination of from and to elements is semantically equivalent to a pipeline.

Pipeline for the InOnly and RobustOnly Exchange Patterns

When there are no Out messages available from the endpoints in the pipeline (ie. the case of the InOnly and RobustInOnly exchange patterns), our pipeline cannot be constructed in the normal way. In this case, the pipeline is built by passing a copy of the original In message to each of the endpoints in the pipeline.