簡體   English   中英

使用int-sftp:inbound-channel-adapter時重新讀取文件

[英]Re Read file when using int-sftp:inbound-channel-adapter

我有一個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>

SftpPersistentAcceptOnceFileListFilter僅控制我們從服務器獲取的內容。 您還需要在local-filter使用FileSystemPersistentAcceptOnceFileListFilter (確定已獲取的文件最終會作為消息發出)。 默認情況下,本地過濾器為AcceptOnceFileListFilter

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM