I have an FTP message source and I want to enable the user to configure the poll frequency through an application.
This is the current configuration of the Inbound channel adapter
@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;
}
My goal is to retrieve the cron expression from the database. Is There a way to achieve this?
Thank you