/// <summary> /// Applies the given BadMessageHandling to the current message. /// </summary> /// <param name="handling"> /// The BadMessageHandling value to apply. /// </param> private void ApplyBadMessageHandling(BadMessageHandling handling) { switch (handling) { case BadMessageHandling.Requeue: shouldDeleteMessage = false; break; case BadMessageHandling.RequeueThenDeleteAfterThreshold: shouldDeleteMessage = (message.DequeueCount >= consumerSettings.BadMessageRequeueThreshold); break; case BadMessageHandling.Delete: shouldDeleteMessage = true; break; case BadMessageHandling.DecidePerMessage: default: throw new NotSupportedException("Unsupported BadMessageHandling: " + handling); } requeueVisibilityTimeout = consumerSettings.BadMessageRequeueTimeout; }
/// <summary> /// Applies the given BadMessageHandling to the current message. /// </summary> /// <param name="handling"> /// The BadMessageHandling value to apply. /// </param> private void ApplyBadMessageHandling(BadMessageHandling handling) { switch (handling) { case BadMessageHandling.Requeue: break; case BadMessageHandling.Delete: shouldDeleteMessage = true; break; case BadMessageHandling.DecidePerMessage: default: throw new NotSupportedException("Unsupported BadMessageHandling: " + handling); } }