Content Filter - 6.3

Talend ESB Mediation Developer Guide

Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
Talend ESB
Design and Development

Camel supports the Content Filter from the EIP patterns using one of the following mechanisms in the routing logic to transform content from the inbound message.

A common way to filter messages is to use an Expression in the DSL like XQuery, SQL or one of the supported Scripting Languages.

Using the Fluent Builders

Here is a simple example using the DSL directly

from("direct:start").setBody(body().append(" World!")).to("mock:result");

In this example we add our own Processor

from("direct:start").process(new Processor() {
    public void process(Exchange exchange) {
        Message in = exchange.getIn();
        in.setBody(in.getBody(String.class) + " World!");

For further examples of this pattern in use you could look at one of the JUnit tests

Using Spring XML

  <from uri="activemq:Input"/>
  <bean ref="myBeanName" method="doTransform"/>
  <to uri="activemq:Output"/>

You can also use XPath to filter out part of the message you are interested in:

  <from uri="activemq:Input"/>
     <xpath resultType="org.w3c.dom.Document">//foo:bar</xpath>
  <to uri="activemq:Output"/>