Use exchange.setException() in your processor.
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#setException%28java.lang.Throwable%29

Elvio

-----Original Message-----
From: M314 [mailto:maciej.piet...@gmail.com] 
Sent: 14 July 2014 09:49
To: users@camel.apache.org
Subject: How should look like exception route in asynchronous processing?

I am about to modify camel based application by changing Processors onto 
AsyncProcessors. I do not fully understand how exception handling route should 
look like when route is consist of AsyncProcessors. Currently most of code 
looks like this:
*Route parts*:

   
onException(MyException.class).handled(true).process(myExceptionHandlerProcessor);

    from(direct:myRoute).process(myBeanProcessor);

*myBeanProcessor*:

    @Component
    public class MyBeanProcessor implements Processor {

        @Override
        public void process(Exchange exchange) throws MyException { ... }

    }

Since AsyncProcessor "MUST not throw any exceptions that occurred while 
processing the exchange", how exception route should looks like? Can someone 
give me simple exmple of route with exception handling with AsyncProcessors?



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-should-look-like-exception-route-in-asynchronous-processing-tp5753776.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to