1 Reply Latest reply on Dec 16, 2013 7:27 AM by pzl_mz

    Property not available in ExchangeInterceptor after Exception

    pzl_mz

      Is it possible to get a property after a RuntimeException in a Component has been thrown?

       

      public class TestServiceBean implements TestService {
           public void process(String message) {
              throw new RuntimeException();
          }
      }
      
      public class GlobalErrorHandler implements ExchangeInterceptor {
           public void after(String target, Exchange exchange) throws HandlerException {
                   Property property = exchange.getContext().getProperty("header1");
                   // property is null after the RuntimeException has been thrown
           }
      }
      
      public class CamelRoute extends RouteBuilder {
           public void configure() {
               from("switchyard://CamelRoute").setHeader("header1", "someValue").to("switchyard://TestService");
           }
      }