Hello Claus!

YUHUUUUU I got it and it is working! Your last posting gave me a reality
check. Thanks a lot.

The following code snippet propagates the exception back to the calling
route:

RouteBuilder No. 1

@Override
public void configure() throws Exception {
        from("activemq:" + JmsDestinations.QUEUE_INIT_MAIN_ROUTE)
                .routeId("initMainRoute")
                .onException(Exception.class)
                .handled(true)
                .to("activemq:topic:" + JmsDestinations.TOPIC_LOG_SERVICE)
                .end()
                .to("*direct:emptyDirectoryRoute*")
                .setHeader("SUCCESS_INIT",
header(EmptyDirectoryDataReceived.IS_DIRECTORY_CLEANSED));
}

RouteBuilder No. 2

@Override
public void configure() throws Exception {
        from("*direct:emptyDirectoryRoute*").routeId("emptyDirectoryRoute")
                .errorHandler(noErrorHandler())                         
                .bean(EmptyDirectoryDataReceived.class) *// throws an exception 
here*
                .setBody(simple("${header." + 
DN1CamelHeader.PROTOCOL_DIRECTORY_CLEANING +
"}"));
}

Thanks Thanks!
Hilde
        

--
View this message in context: 
http://camel.465427.n5.nabble.com/Exception-handling-within-route-chains-tp5715862p5715933.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to