Skip to main content
Table of Contents

Class MessageRetryPolicy

Namespace
Stratara.Abstractions.Messaging
Assembly
Stratara.Abstractions.dll

Decides, from the number of times a message has been delivered and why its handler did not take it, whether the transport redelivers it or dead-letters it. Every transport the framework ships applies this policy from the delivery count its broker supplies, so the bounds in MessageRetryOptions mean the same number of handler runs on each.

public sealed class MessageRetryPolicy
Inheritance
MessageRetryPolicy
Inherited Members
Extension Methods

Constructors

MessageRetryPolicy(MessageRetryOptions)

Decides, from the number of times a message has been delivered and why its handler did not take it, whether the transport redelivers it or dead-letters it. Every transport the framework ships applies this policy from the delivery count its broker supplies, so the bounds in MessageRetryOptions mean the same number of handler runs on each.

public MessageRetryPolicy(MessageRetryOptions options)

Parameters

options MessageRetryOptions

The bounds to apply.

Fields

ConflictReason

The dead-letter reason recorded for a message that exhausted MaxConflictRequeues.

public const string ConflictReason = "conflict"

Field Value

string

FailureReason

The dead-letter reason recorded for a message that exhausted MaxDeliveryAttempts.

public const string FailureReason = "failure"

Field Value

string

Properties

BrokerDeliveryLimit

The delivery count at which a broker's own limit may take over as a backstop: one above the larger of the two bounds, so that the framework's decision always comes first.

public int BrokerDeliveryLimit { get; }

Property Value

int

Methods

Decide(int, MessageFailureKind)

Decides what happens to a message after its handler did not take it.

public MessageDisposition Decide(int deliveryAttempt, MessageFailureKind kind)

Parameters

deliveryAttempt int

How many times the message has been delivered, counting the one that just failed; 1 on the first delivery.

kind MessageFailureKind

Why the handler did not take it.

Returns

MessageDisposition

Whether to redeliver or to dead-letter.

ReasonFor(MessageFailureKind)

The dead-letter reason recorded for kind.

public static string ReasonFor(MessageFailureKind kind)

Parameters

kind MessageFailureKind

Why the handler did not take the message.

Returns

string

ConflictReason or FailureReason.