Spring integration int ftp:入站通道适配器轮询器控制
我们使用intftp:带有固定速率轮询器的入站通道适配器。出于维护目的,我们希望能够在需要时停止轮询器(使用url)。我们使用下面的适配器配置Spring integration int ftp:入站通道适配器轮询器控制,spring-integration,Spring Integration,我们使用intftp:带有固定速率轮询器的入站通道适配器。出于维护目的,我们希望能够在需要时停止轮询器(使用url)。我们使用下面的适配器配置 <int-ftp:inbound-channel-adapter id="inboundAdapter" channel="inputChannel" session-factory="sessionFactory" charset="UTF-8" auto-create-local-directory="false
<int-ftp:inbound-channel-adapter id="inboundAdapter"
channel="inputChannel" session-factory="sessionFactory"
charset="UTF-8" auto-create-local-directory="false"
delete-remote-files="true" filename-regex="^.*\.(txt|in)$"
remote-directory="${remote.directory}" local-directory="${local.directory}">
<poller max-messages-per-poll="-1" fixed-rate="3000" error-channel="errorChannel"/>
</int-ftp:inbound-channel-adapter>
下面是我们需要添加到此适配器的行为
任何修改适配器以实现此目的的建议都很有帮助。要实现此目的,请将适配器的输出通道设置为
nullChannel
添加
以轮询本地目录
停止ftp适配器的轮询器,远程回迁将停止(在当前轮询完成后,如果正在进行),但文件适配器将继续轮询本地目录
要停止/启动ftp适配器,请使用@Autowired
SourcePollingChannelAdapter或使用控制总线。从5.0版开始(GA将于今年晚些时候发布,里程碑4现在可用),您现在可以将适配器的MessageSource
maxFetchSize
属性设置为0以禁用远程抓取,继续轮询本地目录以查找以前获取的文件。这可以通过编程或通过控制总线来完成。