@ -25,7 +25,8 @@ public void sendNotification() {
@@ -25,7 +25,8 @@ public void sendNotification() {
By default, the method invocation will be retried for any exception thrown: with at most
3 retry attempts (`maxRetries = 3`) after an initial failure, and a delay of 1 second
between attempts.
between attempts. If all attempts have failed and the retry policy has been exhausted,
the last original exception from the target method will be propagated to the caller.
[NOTE]
====
@ -99,6 +100,13 @@ TIP: Several attributes in `@Retryable` have `String` variants that provide prop
@@ -99,6 +100,13 @@ TIP: Several attributes in `@Retryable` have `String` variants that provide prop
placeholder and SpEL support, as an alternative to the specifically typed annotation
attributes used in the above examples.
[TIP]
====
During `@Retryable` processing, Spring publishes a `MethodRetryEvent` for every exception
coming out of the target method. This can be used to track/log all original exceptions
whereas the caller of the `@Retryable` method will only ever see the last exception.
@ -200,7 +208,7 @@ If you only need to customize the number of retry attempts, you can use the
@@ -200,7 +208,7 @@ If you only need to customize the number of retry attempts, you can use the
----
var retryTemplate = new RetryTemplate(RetryPolicy.withMaxRetries(4)); // <1>
@ -218,7 +226,7 @@ matched against an exception thrown by a failed operation as well as nested caus
@@ -218,7 +226,7 @@ matched against an exception thrown by a failed operation as well as nested caus
var retryTemplate = new RetryTemplate(retryPolicy);
<1> Specify one or more exception types to include.
@ -251,21 +259,96 @@ and an exponential back-off strategy with a bit of jitter.
@@ -251,21 +259,96 @@ and an exponential back-off strategy with a bit of jitter.
var retryTemplate = new RetryTemplate(retryPolicy);