I have configured spring integration to poll a directory. I have configured InBoundChannelAdaptor with poller configuration of
maxMessagesPerPoll = -1 trigger = PeriodicTrigger(1000)
Also I have provided custom comparator while creating the FileReadingMessageSource, to process the files based on modification datetime.
FileReadingMessageSource source = new FileReadingMessageSource(new Comparator<File>(){
@Override
public int compare(File a , File b)
{
if(a.lastModified() > b.lastModified())
{
return 1;
}else{
return -1;
}
}
})
My folder is having 2000 files, but files are not processing in the lastModified manner, means the oldest file should process first, but it is not happening.