public RetryInterceptorBuilder < T > maxAttempts ( int maxAttempts ) { Assert . isNull ( this . retryOperations , "cannot alter the retry policy when a custom retryOperations has been set" ) ; Assert . isTrue ( ! this . retryPolicySet , "cannot alter the retry policy when a custom retryPolicy has been set" ) ; this . simpleRetryPolicy . setMaxAttempts ( maxAttempts ) ; this . retryTemplate . setRetryPolicy ( this . simpleRetryPolicy ) ; this . templateAltered = true ; return this ; }
Apply the max attempts - a SimpleRetryPolicy will be used . Cannot be used if a custom retry operations or retry policy has been set .