Search code examples
javaspring-integrationspring-integration-sftp

Spring SFTP read file lock


I have configured Spring integration SFTP application to poll file from remote server, and it's working fine if it's running one, where if the same application run's 3 time, to process the files faster, in such case same file is polled by two application's and resulting in duplicate results. how can i avoid this? is there any file locking available in Spring integration?

for configuration part you can look through this SO


Solution

  • You need to use persistent file list filters together with a shared metadata store - e.g. Redis see the documentation.

    This question has a similar setup for FTP.