You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Resequencer

The Resequencer from the EIP patterns allows you to reorganise messages based on some comparator. By default in Camel we use an Expression to create the comparator; so that you can compare by a message header or the body or a piece of a message etc.

The following example shows how to reorder the messages so that they are sorted in order of the body() expression.

Using the Fluent Builders

Error formatting macro: snippet: java.lang.NullPointerException

You can of course use many different Expression languages such as XPath, XQuery, SQL or various Scripting Languages.

You could replace this expression with

resequencer(header("JMSPriority"))

for example to reorder messages using their JMS priority.

Using the Spring XML Extensions

For further examples of this pattern in use you could look at the junit test case

Using This Pattern

If you would like to use this EIP Pattern then please read the Getting Started, you may also find the Architecture useful particularly the description of Endpoint and URIs. Then you could try out some of the Examples first before trying this pattern out.

  • No labels