Search code examples
apache-camelfuseesbjbossfusecamel-ftp

Camel reads the file from FTP endppoint before the complete file is copied to the location


Hi I have a very simple route which reads a file from an FTP location. When I deploy into a service mix(Jboss Fuse) it reads the files as expected.

When I have a large file it reads this file before it has finished copying to the location.

How could I tackle this?


Solution

  • If the problem is that you read the file before the sender has finished sending it, you need to use the 'readlock' parameter with the 'rename' value. That's the only value for that parameter that works over FTP.

    If the problem is that someone reads the file before you are finished sending it you need to use the 'tempPrefix' parameter. This will prefix the filename while still copying its content (so that consumers ignore it at that stage), and only rename to the final filename after the file is completely transfered.

    The FTP component is an extention of the File component. You'll find more information about the 'tempPrefix' parameter here: http://camel.apache.org/file2.html