I have a file gateway configured in our app which polls and generates ESB messages when files appear on the directory being monitored.
Sometimes when we are down, files start to accumulate and we need to process the latest ones first. Is there a way to configure file gateway such that it processes the latest files first? If it can be done only with a custom gateway, which class we need to extend and which method to overwrite? Any pointers to such sample code is appreciated much.
Short answer : yes - you should be able to do this. Write a java.io.FileFilter that lists the files in the order that you desire, and then configure that FileFilter with your file gateway.