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");
}
}
from("switchyard://CamelRoute").setProperty("header1", "someValue").to("switchyard://TestService");
does the trick