diff --git a/src/main/java/org/springframework/retry/policy/SimpleRetryPolicy.java b/src/main/java/org/springframework/retry/policy/SimpleRetryPolicy.java index f3a7828..b5b09bc 100644 --- a/src/main/java/org/springframework/retry/policy/SimpleRetryPolicy.java +++ b/src/main/java/org/springframework/retry/policy/SimpleRetryPolicy.java @@ -167,7 +167,7 @@ public class SimpleRetryPolicy implements RetryPolicy { @Override public boolean canRetry(RetryContext context) { Throwable t = context.getLastThrowable(); - return (t == null || retryForException(t)) && context.getRetryCount() < this.maxAttempts; + return (t == null || retryForException(t)) && context.getRetryCount() < getMaxAttempts(); } /**