Question

I have a file server and two integration servers. Each integration server has the same task. It will pick up file from "incoming" folder of the file server, and then will process it. This service use Spring Integration. Two servers' services work at the same time, which would ensure that even one integration server fails, the other will keep working. Because these two are independent from each other, my question is how can I make sure that both services don't pick up the same file from file server Also master-slave approach is not what I am looking for.

Was it helpful?

Solution

Looks like you can use a file locker. Some thing like this

 <file:inbound-channel-adapter id="filesIn"
       directory="file:${input.directory}" prevent-duplicates="true">
    <file:nio-locker/>
  </file:inbound-channel-adapter>

Check this documentation

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top