When you use handled(true) then the exception will be regarded as handled, and the exchange would be regarded as successfully processed. So if you remove it or set it to handled(false) then file should stay.
On Fri, Mar 18, 2011 at 5:24 PM, balajiu <[email protected]> wrote: > Hello, > > I have following file route in which I want to move the file only upon > successfully processing. In any event of exception I want the file to be > unmodified in the source directory. > > However the the following route is not working as I expected. I am new to > camel and looking for advise. > > In the event exception thrown becasue could not connect to activemq after > splitting the file , I see the file getting processed as per redelivery > attempts and I see partial file moved from source directory to archive > directory. > > I appreciate your help. > > > onException(MessagingException.class).maximumRedeliveries(getExcetionsMaxRetries()).redeliverDelay(getRedeliverDelay()).handled(true).to("bean:mailNotificationProcessor"); > > onException(Throwable.class).handled(true).process(writeToLogFile()).to("bean:mailNotificationProcessor"); > > from("file://c:///servicemix///poller?filter=#FileFilter&move=//c:///servicemix///archive///${file:onlyname}-${date:now:yyyyMMdd}") > .split().method("SplitterBean", > "splitBody").to("activemq:producer").to("bean:updateQueueProcessor") .end(); > > > Thank you, > Balaji > > -- > View this message in context: > http://camel.465427.n5.nabble.com/file-route-not-working-for-Exception-scenario-tp3970018p3970623.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
