简体   繁体   English

使用int-sftp:inbound-channel-adapter时重新读取文件

[英]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.

相关问题 使用自定义扫描程序时,file:inbound-channel-adapter失败 - file:inbound-channel-adapter fails when using a custom scanner 同步工厂删除sftp:inbound-channel-adapter的文件夹 - Synchronization-factory deletes folder for sftp:inbound-channel-adapter 当存在java.net.ConnectException时,int-event:inbound-channel-adapter不起作用:连接被拒绝:connect - int-event:inbound-channel-adapter not working when there is java.net.ConnectException: Connection refused: connect 有没有办法通过代码启动文件:inbound-channel-adapter? - Is there a way to start the file:inbound-channel-adapter through code? 春季整合sftp:inbound-channel-adapter delete-remote-files = false - spring integration sftp:inbound-channel-adapter delete-remote-files=false Spring JPA:入站通道适配器配置 - Spring jpa:inbound-channel-adapter configuration 使用Spring Integration入站通道适配器时重新下载消息 - Re downloading of message when using spring integration inbound channel adapter int-ftp:inbound-channel-adapter应该在工作几分钟后重新启动吗? - int-ftp:inbound-channel-adapter should be restart after a few minutes of work? 为什么SFTP入站/出站通道适配器有单独的通道声明,为什么没有简单文件入站/出站通道适配器的通道声明? - Why there is separate channel declaration for SFTP inbound/outbound channel adapter and why not for simple file inbound/outbound channel adapter? 如何防止对“ int-ftp:inbound-channel-adapter”中的旧文件进行处理? - how to prevent process on old files in `int-ftp:inbound-channel-adapter `?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM