0

我有一个 int-sftp:inbound-channel-adapter,它使用 SftpPersistentAcceptOnceFileListFilter 作为复合过滤器的一部分。阅读文档/源代码,如果修改后的日期时间已更改,它应该接受要再次读取的文件,但我无法让它工作,它只读取一次。我使用redis作为商店。

任何想法配置有什么问题,我使用的是 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>
4

1 回答 1

0

SftpPersistentAcceptOnceFileListFilter唯一控制我们从服务器获取的内容。您还需要一个FileSystemPersistentAcceptOnceFileListFilterin local-filter(它确定已获取的哪些文件最终作为消息发出)。默认情况下,本地过滤器是一个AcceptOnceFileListFilter

于 2017-04-27T14:20:58.870 回答