Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The DefaultErrorHandler is configured differently that Dead Letter Channel as it is configured to:

  • not redeliver
  • not handled
  • no dead letter queue (not possible)

By default, any exception thrown during routing will be propagated back to the caller and the Exchange ends immediately. However, you can use the Exception Clause to catch a given exception and lower the exception by marking it as handled. If so, the exception will not be sent back to the caller, and the Exchange continues to be routed.

...

When the ValidationException is thrown from the validateOrder bean, it is intercepted by the DefaultErrorHandler that lets the onException(ValidationException.class) handle it, so the Exchange is routed to this onException route, and since we use handled(true), then the original exception is cleared, and we transform the message into a fixed response that is returned to jetty endpoint that returns it to the original caller.

See Also