Camel FTP Issue Related To Large File Transfer -


i working on requirement related downloading large size files through camel-ftp component. route definition below :

 from("sftp://host:22?connecttimeout=30000&username=xxx&password=yyyy&localworkdirectory=d:/templocation") .to("file:///d:/mylocation"); 

i looking answer below questions.

  1. does camel sfpt supports resume functionality in case there server disconnect.i have observed .inprogress file gets deleted once sockettimeout/ioexception exception thrown underlying jsch library. expectation camel should re establish connection once available , resume downloading point left.

  2. parameters such connecttimeout, timeout , sotimeout have no effect. in windows platform(win 7), if server stays disconnected approximately 21 seconds, camel deletes .inprogress file. there other parameter in camel ftp component has set control consumer timeout. issue if file size large(1 gb or more) , server gets disconnected when more 90% downloaded.

any in regard highly appreciated.

@clausibsen : thank answer. appreciate feedback on point 2.

i went through camel ftp component source code , found sftpoperations.retrievefiletofileinlocalworkdirectory method functionality related retrieving data jsch library implemented.

code such exception received underlying library cause .inprogress file deleted i,e channel.get(remotename, os);. investigated jsch library have option of resume :

get(string src, outputstream dst, sftpprogressmonitor monitor, int mode, long skip)  downloads file outputstream. 

i incorporated api in retrievefiletofileinlocalworkdirectory method tracking if there .inprogress file , if exists, it's filesize.

if(filesize>0) {   channel.get(remotename, os, progressmonitor, channelsftp.resume, filesize    ); } else {  channel.get(remotename, os, progressmonitor); } 

progressmonitor implementation helps me track if download complete or not.

filesize=temp.length(); boolean isfiledownloadcomplete=(filesize==progressmonitor.getmax()); if(isfiledownloadcomplete)     rename , move file. 

with above implementation , commenting out original file deletion behaviour, download resume functionality working. able resume file download though server disconnect .

i have 1 question here : foresee implementation flaw here in above solution. there functionality going impacted missed. appreciate feedback.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -