Skip to content

Conversation

@Krish-cloudsufi
Copy link
Owner

No description provided.

.withBackoff(Duration.ofSeconds(1), Duration.ofSeconds(16))
.withMaxRetries(5)
.onRetry(e -> {
System.out.println("Retry attempt " + e.getAttemptCount() + " due to " + e.getLastException().getMessage());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never use System.out.println in production code, use the logger class

@Override
public AccessToken getAccessToken() {
RetryPolicy<Object> retryPolicy = RetryPolicy.builder()
.handle(IOException.class)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we need to retry only for 5xx errors, please refer the design doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants