Skip to content

Lock bucket for specific users #383

Discussion options

You must be logged in to vote

Is there a way to implement this with Bucket4j.

Out-of-the-box no. Bucket4j just implements token-bucket algorithm. It can provide only simple answer about available tokens. Implementation of thotling and penalty strategis is out of scope, you should implement it by yourself. Anyway dynamic reconfiguration is supported. Blocking of bucket for specified period of time is not supported, but you can aproximatelly emulate this behavior by force consumption.

If there is a way to do this, can you show a minimal example?

No. I have no time to do so, try to start from there https://bucket4j.com/#third-party-articles and ask more concrete questions

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@happyDuke96
Comment options

Answer selected by happyDuke96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants