We are using camel binding component, with camel version 1.6.1.0, on
servicemix for our project. We are leveraging dynamic routing slip in camel
to process our request and are facing issues related to exception handling.
We have already defined global errorHandler which handles any exception that
occurs in any of the route. Now, whenever an exception occurs in any of the
endpoints within routing slip, exception handler is called as expected but
then once the exceptionHandler route is finished, control comes back to the
routingslip and rest of the endpoints get executed. No matter what we set on
exception route ( such as handled=false), all the endpoints in routing slip
eventually gets called. Here is the code snippet from RoutingSlip :


 for (String nextRecipient : recipients) {
            Endpoint<Exchange> endpoint = resolveEndpoint(exchange,
nextRecipient);
            Producer<Exchange> producer =
producerCache.getProducer(endpoint);
            Exchange ex = current.newInstance();

            updateRoutingSlip(current);
            copyOutToIn(ex, current);

            producer.process(ex);

            current = ex;
        }



    We don't see any provision to break from the above loop. Right now, the
work around we have adopted is to set EXCEPTION_HANDLED_PROPERTY on the
exchange so that the pipeline class does not delegate the request to the
actual endpoint. But there is still an overhead of pipeline being called for
all the endpoints configured within the routing slip.

    Any suggestions are welcome.
-- 
View this message in context: 
http://old.nabble.com/How-to-break-from-routing-slip-in-camel-on-exception--tp26594251p26594251.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to