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.
This commit is contained in:
Plummb
2018-03-26 12:21:12 +05:30
committed by Artem Bilan
parent 4b298b3b07
commit da577cfeb2

View File

@@ -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();
}
/**