Beispiel #1
0
        private AckResult ExceptionAckStrategy(IModel model, ulong deliveryTag, PostExceptionAckStrategy strategy)
        {
            switch (strategy)
            {
            case PostExceptionAckStrategy.ShouldAck:
                model.BasicAck(deliveryTag, false);
                return(AckResult.Ack);

            case PostExceptionAckStrategy.ShouldNackWithoutRequeue:
                model.BasicNack(deliveryTag, false, false);
                return(AckResult.Nack);

            case PostExceptionAckStrategy.ShouldNackWithRequeue:
                model.BasicNack(deliveryTag, false, true);
                return(AckResult.Nack);

            case PostExceptionAckStrategy.DoNothing:
                return(AckResult.Nothing);

            default:
                return(AckResult.Nothing);
            }
        }
Beispiel #2
0
 private AckResult ExceptionAckStrategy(IModel model, ulong deliveryTag, PostExceptionAckStrategy strategy)
 {
     switch (strategy)
     {
         case PostExceptionAckStrategy.ShouldAck:
             model.BasicAck(deliveryTag, false);
             return AckResult.Ack;
         case PostExceptionAckStrategy.ShouldNackWithoutRequeue:
             model.BasicNack(deliveryTag, false, false);
             return AckResult.Nack;
         case PostExceptionAckStrategy.ShouldNackWithRequeue:
             model.BasicNack(deliveryTag, false, true);
             return AckResult.Nack;
         case PostExceptionAckStrategy.DoNothing:
             return AckResult.Nothing;
         default:
             return AckResult.Nothing;
     }
 }