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

Demo of rate limiting for the HTTP client #1

Open
lightbody opened this issue Oct 5, 2019 · 1 comment
Open

Demo of rate limiting for the HTTP client #1

lightbody opened this issue Oct 5, 2019 · 1 comment

Comments

@lightbody
Copy link

Hi there!

Thanks for starting this. If you come back to this project, I'd love to see an example of how to apply rate limiting to Micronaut's HTTP client. I'm especially curious about exploring Micronaut's declarative client and whether their @Retry advice is good to pair with reslience4j or whether I'm better off avoiding it in favor of a 100% resilience4j-based solution.

In my particular case, I have an API that returns X-Rate-Limit-Remaining and X-Rate-Limit-Reset to tell me how many more calls I can make and when the rate limit resets (ex: 45 calls left in the next 29 seconds). So ideally my solution runs fast at the start of a window and throttles back just enough to get to 1 call remaining in the next 1 seconds.

@RobWin
Copy link
Member

RobWin commented Oct 14, 2019

Sry, I was on vacation.
I think you won't be able to use Micronauts @Retryable annotation and their advice with resiliencej4.
We have to create our our advice and annotation.

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

2 participants