Table of Contents

Interface RetryContext

Namespace
MassTransit
Assembly
MassTransit.Abstractions.dll

The base context of a retry

public interface RetryContext

Properties

CancellationToken

Canceled when the retry should be canceled (not the same as if the underlying context is canceled, which is different). This can be used to cancel retry, but not the operation itself.

CancellationToken CancellationToken { get; }

Property Value

CancellationToken

ContextType

The context type of the retry context

Type ContextType { get; }

Property Value

Type

Delay

The time to wait before the next retry attempt

TimeSpan? Delay { get; }

Property Value

TimeSpan?

Exception

The exception that originally caused the retry to be initiated

Exception Exception { get; }

Property Value

Exception

RetryAttempt

The retry attempt currently being attempted (should be 1 > than RetryCount)

int RetryAttempt { get; }

Property Value

int

RetryCount

The number of retries which were attempted beyond the initial attempt

int RetryCount { get; }

Property Value

int

Methods

PreRetry()

Called before the retry attempt is performed

Task PreRetry()

Returns

Task

RetryFaulted(Exception)

Called after the retry attempt has failed

Task RetryFaulted(Exception exception)

Parameters

exception Exception

Returns

Task