camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <>
Subject Re: Using rollback() inside onException
Date Sat, 01 Apr 2017 08:03:48 GMT
Thanks, indeed it all works as expected without using rollback().
I had cases of onException().handled(true)....rollback().end() that could be simplified to

On 31.03.2017 17:10, Quinn Stevenson wrote:
> I don’t this this would make sense for handling java.lang.Exception - I think you’re
right about Camel doing the same action by default.
> I guess if there was some other exception you were handling (i.e. handled(true)), you
may want to call rollback - but I can’t think of a really good example right of hand.  The
place’s I’ve used rollback() (actually markRollbackOnly() - I’ve never used rollback())
are in routes where something besides an exception determines whether or not I want to rollback
the transaction.
> For what it’s worth ...
>> On Mar 31, 2017, at 6:18 AM, Martin Lichtin<>  wrote:
>> Hi
>> Wanted to ask, what would be a reason to explicitly call rollback() in an onException().
>> For example, would this make sense?
>> .onException(Exception.class).rollback().end()
>> I'm under the expression above line could just be left out, as Camel anyway lets
>> the exception up and that will cause the transaction to roll back.

View raw message