[ 
https://issues.apache.org/jira/browse/CAMEL-14533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17034451#comment-17034451
 ] 

Claus Skou Nielsen commented on CAMEL-14533:
--------------------------------------------

Ok, I'll give it a go.

> 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
>            Priority: Minor
>             Fix For: 3.x
>
>
> 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)

Reply via email to