You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/08/03 07:43:00 UTC
[jira] [Commented] (CAMEL-14533) camel-ftp: fileExist=Append and
tempPrefix options do not work together
[ https://issues.apache.org/jira/browse/CAMEL-14533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169788#comment-17169788 ]
Claus Ibsen commented on CAMEL-14533:
-------------------------------------
The file component throws an exception so lets do the same for ftp
> camel-ftp: fileExist=Append and tempPrefix options do not work together
> -----------------------------------------------------------------------
>
> Key: CAMEL-14533
> URL: https://issues.apache.org/jira/browse/CAMEL-14533
> Project: Camel
> Issue Type: Bug
> Components: camel-ftp
> Affects Versions: 2.22.2, 2.24.2, 3.0.1
> Reporter: Claus Skou Nielsen
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 3.5.0, 3.4.3
>
>
> If you both have fileExist=Append and tempPrefix=<something> options on a sftp to-endpoint, the de facto behaviour of the route is as if it was configured with fileExist=Override.
> When you think about how fileExist and tempPrefix works, this bug actually makes sense. The temporary prefix makes it so that a "new" file is written every time, and therefore fileExist=Append is just working like it does when there isn't an existing file to append to.
> I think there are a couple of possible solutions to this problem:
> * Document this behaviour in the camel documentation, and let the user be responsible for knowing that these two options are incompatible
> * Throw an exception when building the route if these two mutually exclusive options are used on the same route
> * Make fileExist=Append and tempPrefix=<something> be compatible, by making the 'mv' operation after writing the temporary file merge the two files, instead of replacing it
> * Some other brilliant solution that the camel maintainers will see, that has escaped me
> *Recreate the issue*
> Define and start up the following route:
> {code:java}
> from("timer://loltimer?delay=5000&period=5000")
> .setHeader("CamelFileName", constant("foo.txt"))
> .setBody(constant("Davs"))
> .to("sftp://mysftpserver:22/fileappendtest?username=myusername&password=mypassword&fileExist=Append&tempPrefix=.uploading");{code}
> Then you can observe the folder on the sftp-server, and see that the file size never increases, but the files Last-Modified timestamp gets renewed every five seconds.
> If you remove the "tempPrefix=.uploading" option from the sftp uri it works like it should, and the file size increases every 5 seconds.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)