camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Murari Raghavan <murari.ragha...@gmail.com>
Subject Re: onException invoked even when there is no exception
Date Fri, 24 Aug 2012 21:19:04 GMT
Thanks Claus.

I would like the OnException to be route specific.

When I define the onException right after .from, the .process call after the
.split() cannot be resolved. That was the reason I moved it after the
.split() call.

Any suggestions?

                from("file://statusresponseinbound")
                       
.onException(Exception.class).log(LoggingLevel.ERROR, "Exception Occurred
#####")
                        .to("file://statusresponseexception").end()
                        .split().method(CXMLDDSStatusResponseSplitter.class,
"splitStatusResponse")
                        .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-tp5717977p5718036.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message