What's the difference between:
<camel:errorHandler id="deadLetterErrorHandler" type="DeadLetterChannel"
deadLetterUri="log:dead">
<camel:camelContext errorHandlerRef="deadLetterErrorHandler">
...
</camel:camelContext>
And:
<onException>
...
</onException>
According to this article, using them both in conjunction is a "powerful combination". How so? What roles do they each individual assume, and how do they complement each other?
The errorHandler
is used to handle any uncaught Exception
that gets thrown during the routing and processing of a message. Conversely, onException
is used to handle specific Exception
types when they are thrown. Check out this article to see how to use onException
.