I am writting sftp-integration-ftp inbound flow code to read file from FTP server and want to ensure that if multiple instances of my service and reading file from same input location then only one process the file from the input directory to avoid duplication.
Code : ''' @Bean public SftpPersistentAcceptOnceFileListFilter getSftpPersistentAcceptOnceFileListFilter(final ConcurrentMetadataStore concurrentMetadataStore) { return new SftpPersistentAcceptOnceFileListFilter( concurrentMetadataStore,"INT_"); }
@Bean
public ConcurrentMetadataStore getConcurrentMetadataStore() {
return new JdbcMetadataStore(jdbcTemplate);
}
@Bean
@InboundChannelAdapter(value = "sftpISLChannel", poller = @Poller(fixedDelay = "30000", maxMessagesPerPoll = "-1"))
public MessageSource<InputStream> sftpISLMessageSource(final SftpPersistentAcceptOnceFileListFilter sftpPersistentAcceptOnceFileListFilter) {
ChainFileListFilter<ChannelSftp.LsEntry> chainFileListFilter = new ChainFileListFilter<>();
chainFileListFilter.addFilter(getCustomOutboundFilter());
chainFileListFilter.addFilter(sftpPersistentAcceptOnceFileListFilter);
SftpStreamingMessageSource source = new SftpStreamingMessageSource(sftpRemoteFileTemplate, null);
source.setRemoteDirectory(properties.getInputDir());
//source.setFilter(getChainFileListFilter());
source.setFilter(chainFileListFilter);
return source;
}
I'm using oracle DB.
So my questions are
do I need to create the tables myself for JdbcMetadataStore ?
select * from INT_CHANNEL_MESSAGE;
select * from INT_GROUP_TO_MESSAGE;
select * from INT_LOCK;
select * from INT_MESSAGE;
select * from INT_MESSAGE_GROUP;
select * from INT_METADATA_STORE
Above Queries return 0 records
Resolved issue
Issue with my local db config