Table of Contents

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

MessageBrokerNegativeAck

RetryDelay

Specifies custom retry delay.

public Duration? RetryDelay { get; }

Property Value

Duration?

SkipDeadLetter

Specifies whether the last failed message attempt should not add it to dead letter.

public bool SkipDeadLetter { get; }

Property Value

bool

SkipRetry

Specifies whether future retries for the message will be skipped.

public bool SkipRetry { get; }

Property Value

bool

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

skipDeadLetter bool

Specifies 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

delay Duration

Custom retry delay. Sub-millisecond components will be trimmed.

skipDeadLetter bool

Specifies 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 delay is not in [0, 2147483647 ms] range.