/// <summary> /// Quick IMessageDeliveryHandler implementation with acknowledge features. /// </summary> /// <param name="producerAck">Decision, when producer will receive acknowledge (or confirm)</param> /// <param name="consumerAckFail">Decision, what will be done if consumer sends nack or doesn't send ack in time</param> public AckDeliveryHandler(AcknowledgeWhen producerAck, PutBackDecision consumerAckFail) { _producerAck = producerAck; _consumerAckFail = consumerAckFail; }
/// <summary> /// Quick IMessageDeliveryHandler implementation. /// Allows all operations, does not keep and sends acknowledge message to producer /// </summary> public SendAckDeliveryHandler(AcknowledgeWhen when) { _when = when; }
/// <summary> /// Implements non-durable basic delivery handler with ack /// </summary> /// <param name="builder">Horse MQ Builder</param> /// <param name="producerAck">Decision, when producer will receive acknowledge (or confirm)</param> /// <param name="consumerAckFail">Decision, what will be done if consumer sends nack or doesn't send ack in time</param> public static HorseMqBuilder UseAckDeliveryHandler(this HorseMqBuilder builder, AcknowledgeWhen producerAck, PutBackDecision consumerAckFail) { builder.Server.DeliveryHandlerFactory = d => Task.FromResult <IMessageDeliveryHandler>(new AckDeliveryHandler(producerAck, consumerAckFail)); return(builder); }