Struct MessageBrokerNegativeAck
- Namespace
- LfrlAnvil.MessageBroker.Client
- Assembly
- LfrlAnvil.MessageBroker.Client.dll
Represents available negative ACK options.
public readonly struct MessageBrokerNegativeAck
- Inherited Members
Properties
Default
Represents default negative ACK, with default retry behavior based on MessageBrokerListener options.
public static MessageBrokerNegativeAck Default { get; }
Property Value
RetryDelay
Specifies custom retry delay.
public Duration? RetryDelay { get; }
Property Value
SkipDeadLetter
Specifies whether the last failed message attempt should not add it to dead letter.
public bool SkipDeadLetter { get; }
Property Value
SkipRetry
Specifies whether future retries for the message will be skipped.
public bool SkipRetry { get; }
Property Value
Methods
NoDeadLetter()
Creates a negative ACK that skips last failed message attempt to add it to dead letter.
[Pure]
public static MessageBrokerNegativeAck NoDeadLetter()
Returns
- MessageBrokerNegativeAck
New MessageBrokerNegativeAck instance.
NoRetry(bool)
Creates a negative ACK that skips any future retries for the message.
[Pure]
public static MessageBrokerNegativeAck NoRetry(bool skipDeadLetter = false)
Parameters
skipDeadLetterboolSpecifies whether the last failed message attempt should not add it to dead letter. Equal to false by default.
Returns
- MessageBrokerNegativeAck
New MessageBrokerNegativeAck instance.
Retry(Duration, bool)
Creates a negative ACK with a custom retry delay.
[Pure]
public static MessageBrokerNegativeAck Retry(Duration delay, bool skipDeadLetter = false)
Parameters
delayDurationCustom retry delay. Sub-millisecond components will be trimmed.
skipDeadLetterboolSpecifies whether the last failed message attempt should not add it to dead letter. Equal to false by default.
Returns
- MessageBrokerNegativeAck
New MessageBrokerNegativeAck instance.
Exceptions
- ArgumentOutOfRangeException
When
delayis not in [0, 2147483647 ms] range.