camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DRy <dirk.rybin...@itellium.com>
Subject Re: Exception handling ... onException
Date Thu, 05 Nov 2009 21:55:04 GMT

Hi,

we use one of the latest 2.1 snapshots (I will have a look at the exact date
tomorrow).

We use the onException-expressions (from the example below) in a
RouteBuilder-class with one defined route. Both onException are placed
before the route definition. So far the scope is global.


DRy


Claus Ibsen-2 wrote:
> 
> What version of Camel are you using?
> 
> And do you use global or route scoped onException ?
> 
> On Thu, Nov 5, 2009 at 3:28 PM, DRy <dirk.rybinski@itellium.com> wrote:
>>
>> Hi,
>>
>> if I use two onException expressions in a route definition like this
>>
>>        onException(UnmarshalException.class)
>>            .useOriginalBody()
>>            .handled(true)
>>                .bean(exceptionLogBean)
>>                .process(new Publish2CenterExceptionBean())
>>            .end();
>>
>>        onException(Exception.class)
>>            .maximumRedeliveries(-1).redeliveryDelay(1000)
>>            .useOriginalBody()
>>            .handled(true)
>>                .bean(exceptionLogBean)
>>            .rollback()
>>            .end();
>>
>> I got two problems:
>>
>> 1)
>> The onEception(Exception.class) part is used all the time! Even if an
>> UnmarshalException (direct hit) is thrown. And no matter if I put
>> onException(Exception.class)... before
>> onException(UnmarshalException.class)... ... ?
>>
>> 2)
>> On the onException(Exception.class) part the bean(exceptionLogBean) is
>> never
>> called ... ?
>>
>> What I try to do is, to handle all "known" exception in seperate
>> onException(...) parts and install a "last line of defence" with the
>> onException(Exception.class).
>>
>>
>> DRy
> 

-- 
View this message in context: http://old.nabble.com/Exception-handling-...-onException-tp26215607p26222792.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message