Search code examples
javaspringspring-integration

Spring Integration file only once from SFTP across several sessions


I have a Spring Integration WorkFlow which downloads files from a SFTP directory. This is done with a RemoteFileInboundChannelAdapterSpec and IntegrationFlows.
Spring Integration remembers within a session which files it has already downloaded, can I do this across sessions e.g. through a database and if so how?


Solution

  • It is done not within the session, but by some specific FileListFilter implementation . For your goal we suggest an SftpPersistentAcceptOnceFileListFilter where its MetadataStore could really be based on some shared database. See more in docs: https://docs.spring.io/spring-integration/docs/current/reference/html/sftp.html#sftp-inbound