【发布时间】:2020-04-02 09:04:21
【问题描述】:
我正在使用 Spring Integration Streaming Inbound Channel Adapter,从远程 SFTP 获取流并解析每一行内容过程。
我用:
IntegrationFlows.from(Sftp.inboundStreamingAdapter(template)
.filter(remoteFileFilter)
.remoteDirectory("test_dir"),
e -> e.id("sftpInboundAdapter")
.autoStartup(true)
.poller(Pollers.fixedDelay(fetchInt)))
.handle(Files.splitter(true, true))
....
它现在可以工作了。但是我只能从test_dir目录获取文件,但是我需要从这个目录和子目录递归获取文件并解析每一行。
我注意到 Inbound Channel Adapter 是 Sftp.inboundAdapter(sftpSessionFactory).scanner(...) 。它可以扫描子目录。但我没有看到Streaming Inbound Channel Adapter 的任何内容。
那么,如何在Streaming Inbound Channel Adapter 中实现“递归地从目录获取文件”?
谢谢。
【问题讨论】:
标签: spring-integration spring-integration-dsl spring-integration-sftp