I am using spring integration sftp inbound streaming channel adapter which polls every few seconds. The inbound adapter is picking the same file for processing multiple times. Below is the configuration.
<int-sftp:inbound-streaming-channel-adapter id="ftpInbound"
channel="ftpChannel"
session-factory="sessionFactory"
filter="filter"
remote-file-separator="/"
remote-directory="/sampleFolder" auto-startup="true">
<int:poller fixed-rate="30000" max-messages-per-poll="1" />
</int-sftp:inbound-streaming-channel-adapter>
<int:stream-transformer id="withCharset" charset="UTF-8"
input-channel="ftpChannel" output-channel="outputChannel"/>
<bean id="filter"
class="org.springframework.integration.file.filters.CompositeFileListFilter">
<constructor-arg>
<list>
<bean
class="sample.CustomFilter">
</bean>
<bean
class="org.springframework.integration.file.filters.
AcceptOnceFileListFilter"/>
</list>
</constructor-arg>
sample.CustomFilter in the above code is a subclass of SftpRegexPatternFileListFilter where I had the accept method modified as below to accept only the file having current date in its name as per the solution present in Spring SFTP varying filename-regex
public boolean accept(ChannelSftp.LsEntry file){
setPattern(new java.text.SimpleFormat("yyyyMMDD").format(new
java.util.Date())+".txt$"
super.accept(file);
}
The issue being faced is the same file being processed multiple files. the file is being retained in the same remote directory after processing. Is there some issue with my filter configuration Can someone help me on this.