/// <summary> /// Configure the pipeline to Ack successfully processed messages (no exception has been thrown when executing /// <see cref="IConsumerPipeContext{T}.MessageProcessor">MessageProcessor</see>) and to retry message when /// processing fail. On failure the message is requeue with an expiration time in another queue that *must* /// be created with the original queue as dead letter queue. This can be done by calling /// <see cref="DelayedRetryMessageAcknowledgementPipe{T}.CreateDelayQueueAsync"/> /// If the message has been retried too many time, it will be rejected. /// </summary> /// <param name="retryDelays"></param> /// <param name="delayedMessagesQueueName">The name of the queue used to keep message until they expire and /// they are re-queued to the original queue. Default : queueName + "-Delayed"</param> /// <param name="retryCountHeaderName">The name of the header used to keep track of the number of retry. /// Default : "DelayedRetryCount"</param> public ConsumerOptionsBuilder <T> WithDelayedRetryMessageAck(TimeSpan[] retryDelays, string?delayedMessagesQueueName = null, string?retryCountHeaderName = null) { _messageAcknowledgmentPipeBuilder = new DefaultConsumerPipeBuilder <T>(() => new DelayedRetryMessageAcknowledgementPipe <T>(retryDelays, delayedMessagesQueueName, retryCountHeaderName) ); return(this); }
/// <summary> /// Configure the pipeline to Ack successfully processed messages (no exception has been thrown when executing /// <see cref="IConsumerPipeContext{T}.MessageProcessor">MessageProcessor</see>) and to retry message when /// processing fail. On failure the message is immediately requeue. /// If the message has been retried too many time, it will be rejected. /// </summary> /// <param name="maxRetryCount"></param> /// <param name="retryCountHeaderName">The name of the header used to keep track of the number of retry. Default="RetryCount"</param> public ConsumerOptionsBuilder <T> WithFastRetryMessageAck(int maxRetryCount, string?retryCountHeaderName = null) { _messageAcknowledgmentPipeBuilder = new DefaultConsumerPipeBuilder <T>(() => new FastRetryMessageAcknowledgementPipe <T>(maxRetryCount, retryCountHeaderName) ); return(this); }
/// <summary> /// Configure the pipeline to Ack successfully processed messages (no exception has been thrown when executing /// <see cref="IConsumerPipeContext{T}.MessageProcessor">MessageProcessor</see>) and to reject message on error. /// </summary> public ConsumerOptionsBuilder <T> WithSimpleMessageAck() { _messageAcknowledgmentPipeBuilder = new DefaultConsumerPipeBuilder <T>(() => new SimpleMessageAcknowledgementPipe <T>() ); return(this); }
public ConsumerOptionsBuilder <T> WithCustomPipe(IConsumerPipeBuilder <T> pipeBuilder) { _customPipes.Add(pipeBuilder); return(this); }
/// <summary> /// Configure the pipe responsible to Ack/Reject the messages /// </summary> /// <param name="pipeBuilder"></param> /// <returns></returns> public ConsumerOptionsBuilder <T> WitheMessageAck(IConsumerPipeBuilder <T> pipeBuilder) { _messageAcknowledgmentPipeBuilder = pipeBuilder; return(this); }