[英]Re Read file when using int-sftp:inbound-channel-adapter
I have a int-sftp:inbound-channel-adapter which uses SftpPersistentAcceptOnceFileListFilter as part of a composite filter. 我有一个int-sftp:inbound-channel-adapter,它使用SftpPersistentAcceptOnceFileListFilter作为复合过滤器的一部分。 Reading the documentation/ source code it should accept a file to be read again if the modified datetime has changed, but I cant get it to work, it only reads is the once.
阅读文档/源代码,如果修改的日期时间已更改,它应该接受要重新读取的文件,但是我无法使其正常工作,它只能读取一次。 Im using redis as the store.
我正在使用redis作为存储。
Any ideas what is wrong with the configuration, Im using spring integration 4.3.5 任何想法配置有什么问题,我都使用spring集成4.3.5
<int-sftp:inbound-channel-adapter id="sftpInboundAdapterCensus"
channel="sftpInboundCensus"
session-factory="sftpSessionFactory"
local-directory="${sftp.localdirectory}/census-local"
filter="censusCompositeFilter"
remote-file-separator="/"
remote-directory="${sftp.directory.census}">
<int:poller cron="${sftp.cron}" max-messages-per-poll="1" error-channel="pollerErrorChannel"/>
</int-sftp:inbound-channel-adapter>
<bean id="censusCompositeFilter"
class="org.springframework.integration.file.filters.CompositeFileListFilter">
<constructor-arg>
<list>
<bean class="org.springframework.integration.sftp.filters.SftpSimplePatternFileListFilter">
<constructor-arg value="*.xml" />
</bean>
<bean id="SftpPersistentAcceptOnceFileListFilter" class="org.springframework.integration.sftp.filters.SftpPersistentAcceptOnceFileListFilter">
<constructor-arg ref="metadataStore" />
<constructor-arg value="censusSampleLock_" />
</bean>
</list>
</constructor-arg>
</bean>
The SftpPersistentAcceptOnceFileListFilter
only controls what we fetch from the server. SftpPersistentAcceptOnceFileListFilter
仅控制我们从服务器获取的内容。 You also need a FileSystemPersistentAcceptOnceFileListFilter
in the local-filter
(which determines which files that have been fetched end up being emitted as messages). 您还需要在
local-filter
使用FileSystemPersistentAcceptOnceFileListFilter
(确定已获取的文件最终会作为消息发出)。 The local filter is an AcceptOnceFileListFilter
by default. 默认情况下,本地过滤器为
AcceptOnceFileListFilter
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.