0

I'm trying to implement a work queue architecture using RabbitMQ. I have a single sender application and multiple consumers.

I use manual ack on the consumers, so in case of failure in handling a request, it will be re-queued for another consumer to handle.

I was wondering what would happen if all the consumers return nack on a specific request. Is there a way to recognize this behavior and mark the request as 'dead' so it's rerouted to the dead letter exchange? In such a case, I'd like to have a separate consumer open on the queue bound to the dead letter exchange and receive all the messages that failed to be handled by any consumer (for logging purposes or executing this request's task locally, without distributed consumers).

Another question I had. When requeueing the request upon receiving NACK from a consumer, will it try to send this request to other consumers or will it try to send to the first available, even if it's the one that already nacked the request?

Thanks

mich8bsp
  • 325
  • 1
  • 3
  • 9

1 Answers1

2
  1. no there is no such a feature in RabbitMQ. You may handle exceptions, and for specific exception send message to the dead queue or if know maximum time that message must live, configure TTL on queue.
  2. if you nack message, it will go to the next AVAILABLE consumer
Azat Nugusbayev
  • 1,391
  • 11
  • 19