-
1. Re: File Consumer - Don't delete if exception
splatch Feb 26, 2013 8:59 AM (in response to stonesoft)You can use moveFailed option to avoid loss of file.
-
2. Re: File Consumer - Don't delete if exception
stonesoft Feb 26, 2013 11:38 AM (in response to splatch)I tried this:
<service name="AccountingFileConsumer" promote="AccountingFileConsumer">
<file:binding.file>
<file:contextMapper/>
<!-- Monitor this directory -->
<file:directory>/forAccounting</file:directory>
<file:consume>
<file:move>Ready/${file:name}</file:move>
<file:moveFailed>Error/${file:name}</file:moveFailed>
<!-- Dont process files until you see a .DONE file with the same name -->
<file:doneFileName>${file:name}.DONE</file:doneFileName>
</file:consume>
</file:binding.file>
</service>
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?
-
3. Re: File Consumer - Don't delete if exception
kcbabo Feb 26, 2013 12:16 PM (in response to stonesoft)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".