Versions Compared

Key

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

...

Tip
titleHandled

See also Exception Clause for more details on the handled policy as this feature was first introduced here and thus we have more docuemntation and samples there.

About moving Exchange to dead letter queue and using the original

...

message

Available as of Camel 2.0
The option useOriginalBody useOriginalMessage is used for routing the original input body message instead of the current body message that potential potentially is modified during routing.

...

The route listen for JMS messages and validates, transforms and handle it. During this the Exchange payload is transformed/modified. So in case something goes wrong and we want to move the message to another JMS destination, then we can configure our Dead Letter Channel with the useOriginalBody option. But when we move the Exchange to this destination we do not know in which state the message is in. Did the error happen in before the transformOrder or after? So to be sure we want to move the original input message we received from jms:queue:order:input. So we can do this by enabling the useOriginalBody useOriginalMessage option as shown below:

Code Block
java
java
    // will use original body
    errorHandler(deadLetterChannel("jms:queue:dead")
       .useOriginalBodyuseOriginalMessage().mamimumRedeliveries(5).redeliverDelay(5000);

...