From da577cfeb2a804417c03f2ef47107434280f4579 Mon Sep 17 00:00:00 2001 From: Plummb Date: Mon, 26 Mar 2018 12:21:12 +0530 Subject: [PATCH] SimpleRetryPolicy: Call getMaxAttempts() instead This is done to support maxAttempts to be configurable at Tenant level in a Multi Tenant Application. In this case, one can simple override getMaxAttempts and return appropriate value based on Context Tenant. --- .../org/springframework/retry/policy/SimpleRetryPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } /**