I'd have to look up the exact FTP route settings for Camel as I don't
recall them.   In FTP protocol the rename command is also a move command.
So you can FTP the entire file into a temporary directory and then do the
rename to move it to your processing directory.  That means that the entire
file will be there already before it starts processing it.  Another way
this is commonly done is your endpoint for file processing might look for
something like files ending with *.xml but when you FTP into that directory
you append .tmp to the end of the file. So the file processor endpoint
doesn't "see" the file until after the file rename which changes it from
.tmp to .xml.

Brad

On Sat, May 14, 2016 at 4:21 AM, Michele <michele.mazzi...@finconsgroup.com>
wrote:

> Hi,
>
> Your route was working fine when you were reading from the local file
> system...
> It is right.
>
> In this case you'd leave that all alone and simply put in a new route to
> read from the FTP location,
> write it to a local location, and then rename the file. Ok I tryed this and
> it works fine.
>
> I have another problem: for each row processed, i write a failed outcome in
> csv file and then upload it on FTP Errors folder.
> I follow this link
>
> http://www.davsclaus.com/2010/12/camel-26-using-done-files-with-fileftp.html
> to do this, but after processing the whole file the upload of file doesn't
> work.
>
> Route is:
>
> <route id="RemoteFileReader">
>         <from
> uri="ftp://username@host/IN?password=xxxxxx&move=Save&stepwise=false";>
>         <to uri="file:/tmp/localWork" />
> </route>
>
> <route id="LocalFileReader">
>         <from
>
> uri="file:/tmp/localWork?delete=true&readLock=changed&readLockCheckInterval=5000&readLockTimeout=15000">
> ... process it
> </route>
> // OnException
> <route id="ReportBuilderRoute">
>         <from uri="direct:messageDiscarded" />
>         <marshal ref="LoggerDataFormat" />
>         <setHeader headerName="OutputUriReport">
>
>
> <simple>{{local.work.directory.report.log}}?fileName=ERR_${file:name.noext}.csv&amp;fileExist=Append&amp;doneFileName=ERR_${file:name.noext}.csv.done</simple>
>         </setHeader>
>         <recipientList>
>                 <header>OutputUriReport</header>
>         </recipientList>
> </route>
> // Upload outcome on FTP
> <route id="ReportFileUploader_Route">
>         <from
>
> uri="{{local.work.directory.report.log}}?doneFileName=ERR_${file:name.noext}.csv.done&amp;readLock=changed&amp;readLockCheckInterval=5000&amp;readLockTimeout=15000"
> />
>         <to
> uri="ftp://username@host
> /IN/Errors?fileName=${file:name.noext}_${date:now:yyyyMMddHHmmss}.csv&password=xxxxx"
> />
> </route>
>
> The route is blocked...Any idea? where is the mistake?
>
> Thank you in advance.
>
> Best regards
>
> Michele
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/FTP-Consumer-has-strange-behaviour-tp5782537p5782584.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to