Versions Compared

Key

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

...

The following example shows how to reorder the messages so that they are sorted in order of the body() expression. That is messages are collected into a batch (either by a maximum number of messages per batch or using a timeout) then they are sorted in order and then sent out to their output.

Using the Fluent Builders

Wiki Markup
{snippet:id=example|lang=java|url=activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/ResequencerTest.java}

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

You So the above example will reorder messages from endpoint direct:a in order of their bodies, to the endpoint mock:result. Typically you'd use a header rather than the body to order things; or maybe a part of the body. So you could replace this expression with

...

for example to reorder messages using their JMS priority.

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

Using the Spring XML Extensions

...