camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <>
Subject Re: [2.9.5] body=null after onException(_).handled(false)
Date Tue, 05 Feb 2013 15:39:01 GMT
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() {
  public void configure() throws Exception {
    onCompletion().onFailureOnly().bean(new ErrorHandler(), "completion");
       .bean(new ErrorHandler(), "exception")
    .dynamicRouter(bean(ErrorHandler.class, "router"));

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

View raw message