Hi Jonathan, Depending on the situation, you could try to use .to("file:kind-of-failed-directory") in the dead letter channel. But, it sounds to me that you should not use a dlc and look first at the moveFailed option of the file-component*:* * https://github.com/apache/camel/blob/master/components/camel-file/src/main/docs/file-component.adoc <https://github.com/apache/camel/blob/master/components/camel-file/src/main/docs/file-component.adoc>*
Enjoy :) Alex On Fri, May 17, 2019 at 7:03 PM Jonathan Cook <jonathan.c...@erars.plus.com> wrote: > Hello, > > I am using the file endpoint with delete=true. My routes pick up files > from a directory and then pass through a number of steps, so are > reasonably complex. I have a dead letter route where in the event of an > error I want to move the original file to a kind of failed directory area. > > But the problem is that when an error occurs, by the time the code runs > inside the dead letter route, the original file has already been deleted > by the FileComponent because of delete=true. If I set this to false it > works OK but the file stays at the original folder which I don't want. > > Do I have to manage this myself, i.e not use delete=true and have > another step in my route (bean or processor) which would delete or move > the file from the original directory at the end of all the processing > rather than rely on the file component? > > Thanks for any suggestions! > > Paul > >