Hi All, 
I am using camel 2.2 and smx 4.2.
I have a camel route as below

String options = "?fileName=" + filename + "&move=.done/" + filename
                                + "_${date:now:yyyyMMdd_hhmmss}" + 
"&moveFailed=.failed/"
                                + filename + "_${date:now:yyyyMMdd_hhmmss}";

          onException(Exception.class) .useOriginalBody()
                  .to(filepath.concat("/error"));
                
                 

                from(filepath.concat(options)).routeId("mr_route")
                 .beanRef("processorBean", 
"process").convertBodyTo(String.class)
                
.to("nmr:urn:com.pf.management.mbean.endpoint").beanRef("processorBean",
"process");


in the nmr endpoint "urn:com.pf.management.mbean.endpoint" , i am setting
the status to ERROR and calling setError(ex) to test error scenario. I am
expecting the above route will be failed and onexception block will be
executed. But it is following normal path of execution and the file is
moving to .done directory.

Please suggest.

here is my NMR endpoint definition

@Override
        public void process(Exchange exchange) {
                log.info("MangementMBeanEndpoint:process(exchange)");
                  if (exchange.getStatus().equals(Status.Active)) {
                                log.info("status active");
                                log.info("exchange is:"+exchange);
                                try{
                                printexchange(exchange);
                                
                                exchange.setStatus(Status.Done);
                                
                                }
                                catch(Exception ex){
                                        log.error("error", ex);
                                        exchange.setStatus(Status.Error);
                                        exchange.setError(ex);                  
                
                                        
                                }
                                finally{
                                        channel.send(exchange);                 
        }
                  }
                
        }

        private void printexchange(Exchange exchange) throws Exception {
                
                
                throw new Exception("test");    }


-- 
View this message in context: 
http://servicemix.396122.n5.nabble.com/setting-error-status-in-NMR-exchnage-tp2473476p2473476.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to