Quarkus Bucket4j - Query #38830
Unanswered
bikramjitnaha
asked this question in
Q&A
Replies: 2 comments
-
SO probably this is greedy algorithm. Then what property I need to use to make it non greedy |
Beta Was this translation helpful? Give feedback.
0 replies
-
@bikramjitnaha Maybe that helps: https://bucket4j.com/8.8.0/toc.html#refill-types |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We are trying to use bucket4j to ratelimit the hits to an endpoint. How do I ensure only 2 requests are are allowed by the endpoint in 10S?
I tried this
quarkus.rate-limiter.enabled: true
quarkus.rate-limiter.buckets.group1.limits[0].permitted-uses: 2
quarkus.rate-limiter.buckets.group1.limits[0].period: 10S
Initially after 2 hits I get a 429 response code which is perfect. But before 10 seconds complete I am allowed to hit the service again. What I need is if I hit it twice then next successful hit should only happen after 10 seconds. How do I do that?
Beta Was this translation helpful? Give feedback.
All reactions