Hi Alex,
> When myBean.slip() throws SpecificException, If I print in.body in
> handleSpecificException(), I can see that it is not null.
>
> If I print it again in handleFailed() it is now null.
Actually I can't reproduce this problem neither under Camel 2.9.5 nor
under Camel 2.10.1.
Here is my minimal example trying to reproduce your behavior:
______________
public class ErrorHandler {
public void exception(Exchange exchange) {
System.out.println("Exception: " + exchange.getIn());
}
public void completion(Exchange exchange) {
System.out.println("Completion: " + exchange.getIn());
}
public void router() {
throw new RuntimeException();
}
}
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
onCompletion().onFailureOnly().bean(new ErrorHandler(), "completion");
from("seda:start")
.onException(Exception.class)
.bean(new ErrorHandler(), "exception")
.handled(false)
.end()
.dynamicRouter(bean(ErrorHandler.class, "router"));
}
});
context.start();
context.createProducerTemplate().sendBody("seda:start","msg");
______________
The output produced by it indicates that both handlers work fine:
______________
Exception: Message: msg
Completion: Message: msg
______________
If you would be so kind and create minimal Maven project with test
case demonstrating the issue, I could debug it and tell you what is
the problem.
Best regards.
--
Henryk Konsek
http://henryk-konsek.blogspot.com