Reputation: 11
I need to transfer files from SFTP server A to SFTP Server B.I am using Spring Integration to do this and implemented a SpringBoot application that is using inboundchanneladapter to download the file from SFTP server A to the local file system and OutputChanneladapter to upload a file from the local server to SFTP server B
SFTP Server A(Source) > Local File System > SFTP Server B(Destination)
I don't have permission to delete files in SFTP server A but I need to delete a file in the local file system after the file has been transferred to Server B (because the size of the local file system will keep on increasing )
Issue As soon File is deleted from local file system .Spring Integration again brings the file back from SFTP server A.If I don't delete the file from local file system then it works fine . I don't want to keep the file in the local file system because of the size issues in future.
Does Spring Integration metadata is deleted when files are deleted from the local file system? I have used AcceptOnceFileListFilter but it is not fixing the issue.PLease suggest
Upvotes: 1
Views: 72
Reputation: 121247
You definitely should show your configuration, but anyway you should consider to use an SftpPersistentAcceptOnceFileListFilter
: https://docs.spring.io/spring-integration/docs/5.0.6.RELEASE/reference/html/sftp.html#sftp-inbound
Starting with version 5.0
such a filter is a default one for remote files though: https://jira.spring.io/browse/INT-4115
Therefore if you override it with some custom filter logic, you have to still supply it via a CompositeFileListFilter
. See the same docs on the matter.
Upvotes: 1