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...
- write file different name, rename it.
- add special file (e.g.
foo.done
whenfoo.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
Post a Comment