Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetryToken: expose attempts, scope and status #5818

Open
1 of 2 tasks
elruwen opened this issue Jan 23, 2025 · 0 comments
Open
1 of 2 tasks

RetryToken: expose attempts, scope and status #5818

elruwen opened this issue Jan 23, 2025 · 0 comments
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@elruwen
Copy link

elruwen commented Jan 23, 2025

Describe the feature

Hi!

I want the RetryToken class to expose the fields attempt count, scope and status so I can get visibility when a retry is happening.

Cheers
Ruwen

Use Case

I am currently migrating from the SDK v1. In the SDK v1 I got custom retry condition which extends PredefinedRetryPolicies.SDKDefaultRetryCondition.

I do that in order to log retries:

    public boolean shouldRetry(AmazonWebServiceRequest originalRequest, AmazonClientException exception, int retriesAttempted) {
        boolean retry = super.shouldRetry(originalRequest, exception, retriesAttempted);
        String source = originalRequest.getClass().getSimpleName();
        LOGGER.warn("Retrying: {}, Retry Attempt: {}, Source: {}, Exception: {}", retry, retriesAttempted, source, exception.getMessage());
        return retry;
    }

In the past that has been quite helpful and so I want to keep that behaviour.

Currently the RetryToken doesn't expose any fields. If I log toString() on the retry token, then the log message is way to verbose.

Proposed Solution

Expose the fields:

  • attempts
  • state
  • scope

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2.29.52

JDK version used

17

Operating System and version

Debian stable

@elruwen elruwen added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant