You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gardella juan <ga...@gmail.com> on 2014/07/01 13:54:24 UTC
File component does not delete file
Hello all,
I am working with camel 2.13.1 and I had problems with delete option, where
it says at File component <http://camel.apache.org/file2.html> :/delete:
If true, the file will be deleted after it is processed/I figured out that
this statement is not true when some error happens. I found the cause at
/org.apache.camel.component.file.GenericFileOnCompletion/. In the method
processStrategyRollback we have this if statement:
// only delete done file if moveFailed option is enabled, as
otherwise on rollback, // we should leave the done file so we can
retry if (endpoint.getMoveFailed() != null) {
handleDoneFile(exchange); }
I think when using delete option, it is not important configure moveFailed.
I suggest update the documentation to warning about this problem. When use
delete, configure moveFailed too or fix the code to delete the file always,
as the documentation says.Thanks in advance,Juan
--
View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File component does not delete file
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Found the bug and logged a ticket
https://issues.apache.org/jira/browse/CAMEL-7577
On Wed, Jul 2, 2014 at 3:11 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Yeah sounds like a bug in zip splitter as it should close the stream
> if there was an exception etc.
>
> On Wed, Jul 2, 2014 at 3:02 PM, Gardella juan
> <ga...@gmail.com> wrote:
>> Thanks Claus, I found the problem and let me know if you agree on create
>> JIRA. I am processing a zip file with zip splitter. I am developing on
>> windows machine and if some exception is not handled during the split the
>> file could not be moved/deleted. It seems the splitter keeps the file open.
>> The only way I can delete/move the file is process all the zip.
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753207.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: File component does not delete file
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Yeah sounds like a bug in zip splitter as it should close the stream
if there was an exception etc.
On Wed, Jul 2, 2014 at 3:02 PM, Gardella juan
<ga...@gmail.com> wrote:
> Thanks Claus, I found the problem and let me know if you agree on create
> JIRA. I am processing a zip file with zip splitter. I am developing on
> windows machine and if some exception is not handled during the split the
> file could not be moved/deleted. It seems the splitter keeps the file open.
> The only way I can delete/move the file is process all the zip.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753207.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: File component does not delete file
Posted by Gardella juan <ga...@gmail.com>.
Thanks Claus, I found the problem and let me know if you agree on create
JIRA. I am processing a zip file with zip splitter. I am developing on
windows machine and if some exception is not handled during the split the
file could not be moved/deleted. It seems the splitter keeps the file open.
The only way I can delete/move the file is process all the zip.
--
View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753207.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File component does not delete file
Posted by Gardella juan <ga...@gmail.com>.
Yes, I discover that, but is it possible to update the document? this is not
explicit mentioned.
--
View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753165.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File component does not delete file
Posted by Claus Ibsen <cl...@gmail.com>.
delete=true only deletes the file if the exchange was processed
succesfully. If some exception is thrown it will rollback, and leave
the file untouched. Or if you use moveFailed the file is moved to
another directory.
If you want to delete the file also if an exception happen then use
the Camel error handler, to handle the exception so the exchange is a
success.
http://camel.apache.org/error-handling-in-camel.html
On Tue, Jul 1, 2014 at 2:08 PM, Gardella juan
<ga...@gmail.com> wrote:
> Using moveFailed does not solve the problem, "delete" does not delete the
> file when some exception happens during the execution, why?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753142.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: File component does not delete file
Posted by Gardella juan <ga...@gmail.com>.
Using moveFailed does not solve the problem, "delete" does not delete the
file when some exception happens during the execution, why?
--
View this message in context: http://camel.465427.n5.nabble.com/File-component-does-not-delete-file-tp5753140p5753142.html
Sent from the Camel - Users mailing list archive at Nabble.com.