You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ravi21588 <ra...@gmail.com> on 2016/06/06 19:31:35 UTC
Onexception and try catch block in camel.
Hi All,
Onexception clause and try catch block both can be specified in with in a
camel route.
Can you please let me know the difference and advantage of using one upon
other.
--
View this message in context: http://camel.465427.n5.nabble.com/Onexception-and-try-catch-block-in-camel-tp5783511.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Onexception and try catch block in camel.
Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
I’d suggest you read the “Error Handling” chapter in “Camel in Action” - it covers onException very well.
For me, I use onException wherever possible - it allows me to use error handlers and exception policies which make my life much easier, and it separates the error handling logic from the routing logic. I’m sure there are cases where you must resort to doTry, but I haven’t had to. If you do need doTry, keep in mind that Camel’s regular error handling no longer applies - you need to deal with everything yourself.
Hope that helps
> On Jun 6, 2016, at 1:31 PM, ravi21588 <ra...@gmail.com> wrote:
>
> Hi All,
> Onexception clause and try catch block both can be specified in with in a
> camel route.
> Can you please let me know the difference and advantage of using one upon
> other.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Onexception-and-try-catch-block-in-camel-tp5783511.html
> Sent from the Camel - Users mailing list archive at Nabble.com.