Versions Compared

Key

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

...

The Dead Letter Channel above will clear the caused exception (setException(null)), by moving the caused exception to a property on the Exchange, with the key Exchange.EXCEPTION_CAUGHT. Then the Exchange is moved to the "jms:queue:dead" destination and the client will not notice the failure.

How to let the client notice the error?

If you want to move the message to the dead letter queue and also let the client notice the error, then you can configure the Dead Letter Channel to not handle the error. For example:

...


errorHandler(deadLetterChannel("jms:queue:dead")
    .maximumRedeliveries(3).redeliverDealy(5000).handled(false));

When all attempts of redelivery have failed the Exchange is moved to the dead letter queue (the dead letter endpoint). As the Dead Letter Channel
is configured to not handle it, it will mark the Exchange as failed so the client will be notified of this error.

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

...