I want to load files via sftp from two separate directories into one local folder. So I have two inbound channel adapters like this:
<bean id="lastModifiedFileFilter" class="com.test.sftp.SftpLastModifiedFileListFilter">
<constructor-arg name="age" value="100"/>
</bean>
<int:poller id="fixedRatePoller" fixed-rate="100"
time-unit="SECONDS"/>
<int-sftp:inbound-channel-adapter id="inbound1"
session-factory="sftpSessionFactory"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/remote-folder1"
filter="lastModifiedFileFilter"
local-directory="/local-folder"
channel="nullChannel">
<int:poller ref="fixedRatePoller"/>
</int-sftp:inbound-channel-adapter>
<int-sftp:inbound-channel-adapter id="inbound2"
session-factory="sftpSessionFactory"
auto-create-local-directory="true"
delete-remote-files="true"
remote-directory="/remote-folder2"
filter="lastModifiedFileFilter"
local-directory="/local-folder"
channel="nullChannel">
<int:poller ref="fixedRatePoller"/>
</int-sftp:inbound-channel-adapter>
And for example if a new file called "test.csv" become in the "remote-folder1" I have the following messages in the log:
INFO Created message: [GenericMessage [payload=local-folder/test.csv, headers={id=bb76252a-e826-579d-b0e1-cab55a7cc957, timestamp=1508242673896}]] [task-scheduler-6][FileReadingMessageSource]
INFO Created message: [GenericMessage [payload=local-folder/test.csv, headers={id=a76de653-f805-8add-1e02-924d0915a18c, timestamp=1508242673962}]] [task-scheduler-2][FileReadingMessageSource]
It looks weird and I don't know why I have two messages per one file. Maybe I have wrong configuration? Some could explain this behavior?