Reputation: 685
We have a microservice which has an endpoint which takes a request, creates a document in couchbase and returns OK. The document is later processed by a spring-scheduler.
We are using docker to deploy the microservice. Now, if we have more than one instance of the app running then we have a problem where each instance will read and process the same document which is not required. At a time only one instance should process the document.
Questions :
Update : We went ahead with the 3rd solution. Its was very simple to implement and seems to satisfy all the cases that we know of.
Upvotes: 2
Views: 402
Reputation: 1890
You could pre-designate the documents to specific back-end processors. When each document is created, add a field to it stating which processor should be responsible for it.
Upvotes: 1