THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
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.
- Message Translator
- invoking a Java bean
- Processor object in the routing logic to filter 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.
...
Wiki Markup |
---|
{snippet:id=example|lang=java|url=activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformViaDSLTest.java} |
...
Wiki Markup |
---|
{snippet:id=example|lang=java|url=activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/TransformTest.java} |
For further examples of this pattern in use you could look at one of the JUnit tests
Using Spring XML
Code Block |
---|
<route>
<from uri="activemq:Input"/>
<bean ref="myBeanName" method="doTransform"/>
<to uri="activemq:Output"/>
</route>
|
You can also use XPath to filter out part of the message you are interested in:
Code Block |
---|
<route>
<from uri="activemq:Input"/>
<setBody><xpath resultType="org.w3c.dom.Document">//foo:bar</xpath></setBody>
<to uri="activemq:Output"/>
</route>
|
Include Page | |||
---|---|---|---|
Include Page | |||
|