Reputation: 101
I'm currently using Rabbitmq, I want to have 2 consumers listening the same queue.
But have only one consumer notify by a new message, and other on failover if first crashes.
How can I do ?
Upvotes: 1
Views: 210
Reputation: 10202
Simply don't ACK the message until you have finished processing it. So you have to do manual ACK instead of automatic. If the first consumer crashes before it finished processing the message, it will not ACK it, the broker will re-queue the message and the other consumer will get it.
Upvotes: 1