Hi You should move the onException outside the route. Or if you want it to be route specific, then configure it right after the from(). Not in the middle of the route.
On Fri, Aug 24, 2012 at 7:56 AM, Murari Raghavan <murari.ragha...@gmail.com> wrote: > Hello: > > In the below scenario - OnException is invoked every time, even when there > are no exceptions and the files are processed properly. > > Is there anything wrong with the route? Is there a way to print the > stacktrace if an exception occurs? > > from("file://statusresponseinbound") > .split().method(CXMLDDSStatusResponseSplitter.class, > "splitStatusResponse") > > .onException(Exception.class).to("file://statusresponseexception") > .log(LoggingLevel.ERROR, > exceptionMessage().toString()) > .end() > .process(new Processor() { > public void process(Exchange exchange) throws > Exception { > > String PO = > getOrderID(exchange.getIn().getBody().toString(),"OrderReference", > "statusresponse" ); > System.out.println("PO : " + PO); > exchange.getIn().setHeader("CamelFileName", > "cxml_OrderUpdate_" + PO + "_" + getDateTime()+".xml"); > } > }) > .to("file://statusresponseoutbound"); > > Thanks, > Murari > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/onException-invoked-even-when-there-is-no-exception-tp5717977.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen