You can use moveFailed option to avoid loss of file.
I tried this:
<service name="AccountingFileConsumer" promote="AccountingFileConsumer">
<!-- Monitor this directory -->
<!-- Dont process files until you see a .DONE file with the same name -->
In the bean that is called to consume the file, I put in code generate an Exception which I catch and then throw a HandlerException. It still moved the file to the Ready directory not the Error directory. What am I doing wrong?
There is a limitation right now where the error is not propagated back to the gateway for in-only message exchange patterns. The error is not dropped - it's logged, but that's not enough for the case you are describing. We are actually meeting this week to discuss some core changes and this will be included. I will post back to the forum with a potential solution. If the core changes go as planned, the answer will simply be "it just works now".