camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <>
Subject Re: Handling error per endpoint
Date Tue, 07 Oct 2014 06:59:05 GMT
Hi Aryan,

The onException() is an interceptor which is called before and after
leaving one of the processors defined in a Apache Camel route. So,
basically, it can't be used to intercept exceptions throwed by a specific
processor/endpoint. Nevertheless, you could imagine to set a specific
Header value inside your processor A or B that you will check with the
onException().onWhen(header("processor").isEqualTo("A")). The alternative
as you did is to use doTry around the endpoint/processor


On Mon, Sep 29, 2014 at 3:04 PM, Aryan <> wrote:

> Hi All,
> We have a camel route and we want to handle exceptions per endpoint. For
> example, if the exception is thrown from processor A, we want A number of
> retries, if thrown from processor B, we want B number of retries and so on.
> We can handle the exception using doTry and throw our customized exception
> per endpoint and then apply different number or retries using OnException.
> Not sure if it is the best approach though. Camel allows exceptions
> policies
> to be applied per route and per context, is it possible to configure it per
> endpoint? Please advice. Or is there any other clean way to do it.
> Thanks!
> Aryan
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message