I'm kind of new to rabbitmq and i was wondering what is the best way to handle an error I'm having when a delete a queue before I can ack a delivery on that queue.
if err := handle(); err != nil {
delivery.Nack(false, true)
} else {
delivery.Ack(false)
}
The problem with this code is that our queues are created/deleted based on a coordinator external to our dispatcher, so when delivery is Nack and the queue was deleted the system hangs because it keeps trying to requeue the delivery.
To solve the problem I can just check if the:
delivery.Nack(false, true)
returns an error and I can handle it there. But what would be the best approach to drop this delivery if the Nack method returned an error?
Note: I'm using https://github.com/streadway/amqp