【发布时间】:2018-09-13 12:49:02
【问题描述】:
我看了很多,这是我的配置,如何动态更改 poller cron?例如,当应用程序运行时,我更改了数据库中的 poller cron,它应该被 InboundChannelAdapter 中的 Poller 拾取。
注意:我不使用 spring 云配置,所以 @RefreshScope 不是一个真正的选项
@Bean
@InboundChannelAdapter(channel = "sftpStreamChannel", poller = @Poller(cron = "${pollerCron}", maxMessagesPerPoll = "-1"))
public MessageSource<InputStream> sftpMessageSource()
{
SftpStreamingMessageSource source = new SftpStreamingMessageSource(template());
source.setRemoteDirectory(sftpRemoteDirectory);
source.setFilter(abSftpFileFilter());
return source;
}
【问题讨论】:
标签: spring spring-integration spring-integration-sftp