Exclude camel file exception
When I try to process a file in Camel and it doesn't work, I try to move the file to the error directory, but I get the following error:
org.apache.camel.component.file.GenericFileOperationFailedException: Unable to delete file: ....
I don't know if Windows is blocking the file, but I have closed threads that could cause this to happen on my side. If this is Windows, what can I do to release this lock?
The route is simple from()... process().. to()
and process()
there are some headers after . This to()
is where it fails and the file is not moved to the error directory as expected.
Thank.
source to share
Perhaps it has something to do with this :
Unable to move / delete file after processing in Windows
There is a potential issue on Windows platform with Camel 1.5.x. That it cannot move or delete the file after processing. You should get an exception.
A workaround is to convert the body to a string after consumption using convertBodyTo: ex. from ("file: // incoming") .convertBodyTo (String.class) .to ("file: // outgoing") ;.
Camel 1.6.0 should have a fix, but we'd love to get some feedback on this. So if you are on Windows, please give it a go.
source to share