I have an API that can be scaled horizontally. The API will acknowledge the client requests and it needs to dispatch the work to a secondary system. The secondary system needs to process the work on a first come first serve basis, a queue. Also since the secondary system is accessing resources that can be shared only one instance of it can be active at a given time. The secondary system needs to have a fail over mechanism. If the 1st instance of the secondary system goes down another instance needs to take its place.
I was thinking of using RabbitMQ as the queuing mechanism and have multiple consumers connect but have only one active consumer that will process the work. One of the other instances will take up the job of processing messages if the previously active consumer fails to acknowledge messages. Is this possible with RabbitMQ ?
Also is it possible to acknowledge the message only after the job has been completed?
Thank you.