/// <summary> /// Negative acknowledge the message, the message will be returned to the queue or send to dead letter exchange. /// </summary> /// <param name="msg">The message instance</param> /// <param name="requeue">False will send to dead letter exchange, true will send back to the queue.</param> private void Nack(RabbitWorkMessage msg, bool requeue = false) { if (ConsumerChannel.IsOpen) { // check max retry limit if (!requeue && !CheckRetryLimit(_maxRetry - 1, msg)) { return; } ConsumerChannel.BasicNack(msg.DeliveryTag, false, requeue); } }