Hello!

We design different camel routes in different RouteBuilder classes and the
one is 
calling the other one:

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")
                        .onException(Exception.class)
                        .end()
                        .bean(EmptyDirectoryDataReceived.class)
                        .setBody(simple("${header." + 
DN1CamelHeader.PROTOCOL_DIRECTORY_CLEANING
+ "}"));
        }

How can we reach that the exception handling in route No. 1 catches and
handles all exceptions that are thrown in route No. 2?
Global scoped exception handling seems not an alternative because we have
many routes and exceptions should be handled individually.

Many thanks
Hilde


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

Reply via email to