The AutoRetry
aspect, when applied to a method, retries the execution of the method when the previous execution results in an exception.
You can use the AutoRetry
aspect to improve the stability of your application by making it more resilient to anticipated, temporary failures.
The AutoRetry
aspect is most often applied to code that attempts to connect to a remote service or a network resource.
The maximum number of retries and the delay between retries can be configured using the attribute properties MaxRetries
and Delay
.
The AutoRetry
aspect implementation demonstrates how to use the MethodInterceptionAspect
and also shows how to use custom attribute properties to customize the aspect.