Camel FTP component fails to process multiple files at once from a specified folder -----------------------------------------------------------------------------------
Key: CAMEL-4010 URL: https://issues.apache.org/jira/browse/CAMEL-4010 Project: Camel Issue Type: Bug Components: camel-ftp Affects Versions: 2.6.0 Environment: Camel 2.6.0-fuse-0.1-0.9 Running in ServiceMix Java 1.6 Reporter: Laurentiu Trica Priority: Critical Camel FTP component fails to process multiple files at once from a specified folder (let's assume the folder is /in). When the consumer connects to a ftp account and finds a list of, let's say, 3 files, it will try to retrieve them in parallel but this is not handled properly. As you can see from the below FTP server log, this is what Camel FTP does: - it changes the current directory to /in - retrieves the file - it changes the current directory to / - the second (probably) thread changes the directory to /in - retreives the second file - the first (probably) thread sends a delete command but it sends it as if it were in the root folder but it is actually in the /in folder - the FTP gives an error that the file doesn't exist - somehow the FTP Component blocks itself on the first file... See my comments in the following log starting with ***** (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 257 "/" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> CWD in (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 250 CWD successful. "/in" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> PASV (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 227 Entering Passive Mode (192,168,0,25,228,206) (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> RETR WS_1001_1.xml (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 150 Connection accepted (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> SSL connection for data connection established (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 226 Transfer OK (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> CWD / (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 250 CWD successful. "/" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> PWD (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 257 "/" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> CWD in (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 250 CWD successful. "/in" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> PASV (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 227 Entering Passive Mode (192,168,0,25,228,207) (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> RETR WS_1001_2.xml (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 150 Connection accepted (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> DELE in/WS_1001_1.xml ***** The location is already /in, should be DELE WS_1001_1.xml (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 550 File not found (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> PASV (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 227 Entering Passive Mode (192,168,0,25,228,208) (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> NLST in (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 550 Directory not found (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> PWD (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 257 "/in" is current directory. (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> CWD in ***** Current directory is already /in (002386)5/20/2011 17:07:03 PM - sftp-test (192.168.0.194)> 550 CWD failed. "/in/in": directory not found. For the whole FTP server logs go here: http://pastie.org/private/kknnkxpbyzqmai7gsm8z5g For the Servicemix/Camel(Trace) log: http://pastie.org/private/eulookxiepan3nkjyu41a A workaround that seems to work is to use the maxMessagesPerPoll=1 option. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira