camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <>
Subject Re: FTP Consumer has strange behaviour
Date Fri, 13 May 2016 13:53:00 GMT

One thing you should probably do when working with FTP files is make sure
your actions are atomic.  I'm not sure if this is what you're running into
but it's a good idea anyway.  FTP the file to a tmp directory and then move
the file via rename to a directory that you process in.  That ensures that
the entire file is present before you start processing it. I don't know if
that will solve the problem or not I'm just saying its a good practice.  Or
if you are using the same file name all the time then you can FTP the file
in with a .tmp extension so your file reader route doesn't detect and then
do a rename of the file to  remove the .tmp and now your file reader sees
the new file and it is all there.

I've had issues when using FTP in anything but an atomic fashion like that.
Read/write locking is problematic in Java and with ancient technologies
like FTP and heterogeneous OSes.  Your route was working fine when you were
reading from the local file system I believe.  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.

On Fri, May 13, 2016 at 4:13 AM, Michele <>

> Hi Claus,
> I replace
>    .split().tokenize("\n", 1000).streaming()
> with
>   .split(body(String.class).tokenize("\n")).streaming()
> and the file content is read correctly.
> Why? Is wrong the FTP consumer configuration?
> I use Camel  version 2.15.1 with JBoss Fuse 6.2.
> Thanks in advance.
> Best regards
> Michele
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message