linux - spring integration sftp inbound channel adapter and temp file issue -


we using spring integration sftp inbound channel adapter poll every few seconds , downloads zip file local dir further processing. problem starts when there big file client still uploading file , inbound adapter picks incomplete file. using acceptallfilefilter remote filtering , local have custom filter.

is there better way ignore or check if file uploaded , pick processing?

this classic problem (s)ftp - fetching partial files.

there 2 common solutions...

  1. write file different name, rename it.
  2. add special file (e.g. foo.done when foo.zip complete).

spring integration (on writing side) uses 1) (writes file foo.zip.writing , renames foo.zip). simplest mechanism because it's easy filter .writing files - spring integration automatically.

2) little more difficult because need write custom filelistfilter ignore foo.zip if foo.done not present.

the underlying (s)ftp protocols have no way prevent fetching partial files without using mechanism these.

edit:

if have no control on sender write custom filter (filelistfilter) fetch file if hasn't changed since time.

this not spring integration issue it's problem has solved application using (s)ftp. spring integration provides 1 solution, , hooks need solve situation.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -