【发布时间】:2018-11-05 10:46:24
【问题描述】:
我有一个 FTP 消息源,我想让用户通过应用程序配置轮询频率。
这是入站通道适配器的当前配置
@Bean
@InboundChannelAdapter(channel = "fromSmartpath", poller = @Poller(cron = "0 15 8 ? * MON,TUE,WED,THU,FRI,SAT"))
public MessageSource<File> sftpMessageSource() throws SftpException {
SftpInboundFileSynchronizingMessageSource source = new SftpInboundFileSynchronizingMessageSource(
sftpInboundFileSynchronizer());
source.setLocalDirectory(new File(Constants.LOCAL_REPOSITORY_PATH));
source.setAutoCreateLocalDirectory(true);
source.setLocalFilter(new FileSystemPersistentAcceptOnceFileListFilter(metaDataStore(), "metastore"));
return source;
}
我的目标是从数据库中检索 cron 表达式。有没有办法做到这一点?
谢谢
【问题讨论】:
标签: ftp spring-integration poller