Hello, dear users of Camel, 

I encountered an issue when I tried to configure an error ignoring route with 
onCompletion.

I have a route with onCompletion part that I expect to get executed in all the 
possible cases (except route stopped). This onCompletion part works well with 
and without exceptions being thrown.

When exceptions are thrown, Camel executes its default strategy which includes 
errors appearing in the logs, redelivering, etc.

There is an exception of a certain kind that I don’t want to be handled: to 
appear in the logs, to be attempted to be redelivered.

I added onException part to the route with onWhen that determines if an error 
should be ignored and the exception is marked as handled. The point was to 
avoid such errors being logged and propagated for handling.

The behavior I witnessed in this case, suggests that once a route gets an 
exception marked as handled the corresponding message doesn’t get handled in 
the onCompletion block. I witness the same behavior when I use `continued` 
instead of `handled`.

I wonder if this behavior is aligned with the design or if it’s a bug. 

As a user, I’d expect the steps in the `onCompletion` clause to be executed no 
matter what unless the route is stopped. 


I’d appreciate you sharing your thoughts here.

Best regards,
Ed


Reply via email to