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
ContextType
The context type of the retry context
Type ContextType { get; }
Property Value
Delay
The time to wait before the next retry attempt
TimeSpan? Delay { get; }
Property Value
Exception
The exception that originally caused the retry to be initiated
Exception Exception { get; }
Property Value
RetryAttempt
The retry attempt currently being attempted (should be 1 > than RetryCount)
int RetryAttempt { get; }
Property Value
RetryCount
The number of retries which were attempted beyond the initial attempt
int RetryCount { get; }
Property Value
Methods
PreRetry()
Called before the retry attempt is performed
Task PreRetry()
Returns
RetryFaulted(Exception)
Called after the retry attempt has failed
Task RetryFaulted(Exception exception)
Parameters
exception
Exception