We have a spring integration application which is running in a cluster on multiple nodes. A NFS drive is mounted across all nodes and is readable by all nodes.
On NFS there is a folder which is being watched by file:inbound-channel-adapter
of all nodes with a polling interval of 5 seconds.
The problem is 1) One node should not pick up a file which has been picked up by other node
2) If a file is picked up by a thread on one node, second thread which runs after polling interval should not pick it up- I have in place AcceptOnceFileListFilter
for this one, but wondering if there is a better way.
One of options which we have looked at already:
1) Create a record in DB with unique filename and every other node checks on same DB before starting processing
Have to yet look at NIOLocker - but need some inputs on it's reliability and possible options in this scenario.