mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Further clarify the meaning of maxAttempts in FixedBackOff and ExponentialBackOff
See gh-36119
This commit is contained in:
@@ -52,7 +52,7 @@ import org.springframework.util.Assert;
|
||||
* should accumulate before returning {@link BackOffExecution#STOP}.
|
||||
* Alternatively, use {@link #setMaxAttempts} to limit the number of back-off
|
||||
* attempts (in a retry scenario, this is equivalent to the maximum number of
|
||||
* retries in addition to the original invocation).
|
||||
* retries excluding the original invocation).
|
||||
* The execution stops when either of those two limits is reached.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
@@ -231,7 +231,7 @@ public class ExponentialBackOff implements BackOff {
|
||||
* The maximum number of back-off attempts after which a call to
|
||||
* {@link BackOffExecution#nextBackOff()} returns {@link BackOffExecution#STOP}.
|
||||
* <p>Note that in a retry scenario, this is equivalent to the maximum number
|
||||
* of retries in addition to the original invocation.
|
||||
* of retries excluding the original invocation.
|
||||
* @param maxAttempts the maximum number of attempts
|
||||
* @since 6.1
|
||||
* @see #setMaxElapsedTime
|
||||
@@ -244,7 +244,7 @@ public class ExponentialBackOff implements BackOff {
|
||||
* Return the maximum number of back-off attempts after which a call to
|
||||
* {@link BackOffExecution#nextBackOff()} returns {@link BackOffExecution#STOP}.
|
||||
* <p>Note that in a retry scenario, this is equivalent to the maximum number
|
||||
* of retries in addition to the original invocation.
|
||||
* of retries excluding the original invocation.
|
||||
* @return the maximum number of attempts
|
||||
* @since 6.1
|
||||
* @see #getMaxElapsedTime()
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.springframework.util.backoff;
|
||||
* A simple {@link BackOff} implementation that provides a fixed interval
|
||||
* between two attempts and a maximum number of back-off attempts (in a
|
||||
* retry scenario, this is equivalent to the maximum number of retries
|
||||
* in addition to the original invocation).
|
||||
* excluding the original invocation).
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @author Sam Brannen
|
||||
@@ -92,7 +92,7 @@ public class FixedBackOff implements BackOff {
|
||||
/**
|
||||
* Set the maximum number of back-off attempts.
|
||||
* <p>Note that in a retry scenario, this is equivalent to the maximum number
|
||||
* of retries in addition to the original invocation.
|
||||
* of retries excluding the original invocation.
|
||||
*/
|
||||
public void setMaxAttempts(long maxAttempts) {
|
||||
this.maxAttempts = maxAttempts;
|
||||
@@ -101,7 +101,7 @@ public class FixedBackOff implements BackOff {
|
||||
/**
|
||||
* Return the maximum number of back-off attempts.
|
||||
* <p>Note that in a retry scenario, this is equivalent to the maximum number
|
||||
* of retries in addition to the original invocation.
|
||||
* of retries excluding the original invocation.
|
||||
*/
|
||||
public long getMaxAttempts() {
|
||||
return this.maxAttempts;
|
||||
|
||||
Reference in New Issue
Block a user