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

Retry with Oauth10aService while calling external Rest API end points #1027

Open
abhishekjoy1 opened this issue Nov 16, 2021 · 0 comments
Open

Comments

@abhishekjoy1
Copy link

Hi, I have been using OAuth10aService and for calling REST APIs as follows:

     public Response executeOAuthRequest(OAuthRequest request) {
               return oAuth10aService.execute(request);
       }

Now, I would like to introduce retries while calling external APIs with the above method.

In this context, I was looking for if OAuth10aService directly provides retry utility out of the box. I did not find any.

So I was thinking to use Spring @Retry annotation something like following:

     @Retryable(maxAttempts=3, includes = {HttpServerErrorException.class}, 
             backoff = @Backoff(delay = 100, multiplier = 2))
     public Response executeOAuthRequest(OAuthRequest request) {
               return oAuth10aService.execute(request);
       }

I am not sure if this is the best approach for retrying with OAuth10aService .

Could anyone please help here? Thanks.

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

No branches or pull requests

1 participant