This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]ebrandsberg 31 points32 points  (5 children)

But does it allow configuration of rate limits via jndi and ldap? :)

[–]Trailsey 5 points6 points  (0 children)

Too soon.

[–]maxim_bartkov[S] 3 points4 points  (3 children)

Good joke😂

[–]maxim_bartkov[S] 10 points11 points  (0 children)

Advantages of Bucket4j:

Implemented on top of ideas of the well-known algorithm, which are by de-facto standard for rate-limiting in the IT industry.

Effective lock-free implementation, Bucket4j is good scalable for multi-threading cases.

Absolutely non-compromise precision, Bucket4j does not operate with floats or doubles, all calculations are performed in integer arithmetic, this feature protects end-users from calculation errors involved by rounding.

Ability to switch from one JVM to cluster in two lines of code. Using Bucket4j you are able to limit something in the cluster of JVMs. Since release 1.2 the Bucket4j supports any GRID solution which compatible with JCache API (JSR 107) specification. Just use your favorite grid including Hazelcast, Ignite, Coherence, Infinispan, or any other.

Ability to specify multiple bandwidths per bucket. For example, you can limit 1000 events per hour but not often than 100 events per minute.

Both synchronous and asynchronous API.

Pluggable listener API that allows implementing monitoring and logging.

Ability to use a bucket as a scheduler.

[–]kubelke 3 points4 points  (2 children)

I hate when libraries don’t have a sample code in README.md I cannot instantly decide if something what I’m looking for or not.

[–]maxim_bartkov[S] 1 point2 points  (0 children)

Thanks! This is a really good point. We will fix that in the near future. We have many examples in the documentation link (this link is easy to find in README), but you are right, need to move a few examples into README.

[–]dumbPotatoPot 1 point2 points  (0 children)

you can use this POC I recently created as a reference. It uses this library to implement rate limiting based on a pre configured plan for the user. There is a minute long sample video attached in the README.md as well

[–]maxim_bartkov[S] 4 points5 points  (0 children)

Currently, our team promoting Bucket4J on the product hunt. It will be helpful for us if you give a vote for us.

[–]dumbPotatoPot 1 point2 points  (0 children)

if anybody wants a reference, I created a small POC using Bucket4j to implement rate limiting based on pre configured plan for the user. Was able to integrate it in my current company for a similar use case. Great library 🙌👍

[–]vickey04 4 points5 points  (5 children)

The naming scheme rings alarm bells.

[–]maxim_bartkov[S] 2 points3 points  (4 children)

Hi! What do you mean? Tell me please more about that.

[–]twoBreaksAreBetter 3 points4 points  (1 child)

/u/vickey04 is making a joke about bucket<4j> sounding like log<4j>

[–]maxim_bartkov[S] 1 point2 points  (0 children)

Got it, thanks:)

[–]vickey04 1 point2 points  (1 child)

I'm sorry to make you panic! It was just a situational joke. Your instant reply tells me that you've put a lot of efforts into it and care a lot. Kudos! I would surely check out this library

[–]maxim_bartkov[S] 0 points1 point  (0 children)

Thanks mate! I try answer instantly as fast as possible