SFTP持久性接受只在sftp网关过滤一次

问题描述:

我有这个代码中我想合并一个SftpPersistentAcceptOnceFileListFilter,我不知道如何。过滤器应在本地检索文件之前进行。SFTP持久性接受只在sftp网关过滤一次

@InboundChannelAdapter(value = "sftpMgetInputChannel", 
    poller = @Poller(fixedDelay = "5000")) 
public String filesForMGET(){ 
    return "'/tmp/input/remoteDirectory/*'"; 
} 

@Bean 
public IntegrationFlow sftpMGetFlow() { 
    return IntegrationFlows.from("sftpMgetInputChannel") 
      .handleWithAdapter(h -> h.sftpGateway(this.sftpSessionFactory, 
      Command.MGET, "payload") 
      .options(Option.RECURSIVE) 
      .regexFileNameFilter("((\\d{8})|*\\.txt)") 
      .localDirectoryExpression("'sftp-inbound/'" + "#remoteDirectory")) 
      .handler(messageHandler()) 
      .get(); 
} 

@Bean 
public MessageChannel sftpMgetInboundChannel(){ 
    return new DirectChannel(); 
} 

@Bean 
public MessageHandler messageHandler(){ 
return new MessageHandler() { ... } 
} 

使用CompositeFileListFilterChainFileListFilterSftpRegexPatternFileListFilter过滤器和SftpPersistentAcceptOnceFileListFilter

构建过滤器并使用.filter(compositeFilter())

+0

过滤器中的前缀ctor arg只是允许在多个过滤器中使用相同的存储区进行隔离。 –