bucket4j-hazelcast

Bucket4j integration with Hazelcast 4.x branch

License

License

Categories

Categories

Hazelcast Application Layer Libs Distributed Applications bucket4j General Purpose Libraries Utility
GroupId

GroupId

com.github.vladimir-bukhtoyarov
ArtifactId

ArtifactId

bucket4j-hazelcast-4
Last Version

Last Version

4.9.0
Release Date

Release Date

Type

Type

jar
Description

Description

bucket4j-hazelcast
Bucket4j integration with Hazelcast 4.x branch

Download bucket4j-hazelcast-4

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.vladimir-bukhtoyarov/bucket4j-hazelcast-4/ -->
<dependency>
    <groupId>com.github.vladimir-bukhtoyarov</groupId>
    <artifactId>bucket4j-hazelcast-4</artifactId>
    <version>4.9.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.vladimir-bukhtoyarov/bucket4j-hazelcast-4/
implementation 'com.github.vladimir-bukhtoyarov:bucket4j-hazelcast-4:4.9.0'
// https://jarcasting.com/artifacts/com.github.vladimir-bukhtoyarov/bucket4j-hazelcast-4/
implementation ("com.github.vladimir-bukhtoyarov:bucket4j-hazelcast-4:4.9.0")
'com.github.vladimir-bukhtoyarov:bucket4j-hazelcast-4:jar:4.9.0'
<dependency org="com.github.vladimir-bukhtoyarov" name="bucket4j-hazelcast-4" rev="4.9.0">
  <artifact name="bucket4j-hazelcast-4" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.vladimir-bukhtoyarov', module='bucket4j-hazelcast-4', version='4.9.0')
)
libraryDependencies += "com.github.vladimir-bukhtoyarov" % "bucket4j-hazelcast-4" % "4.9.0"
[com.github.vladimir-bukhtoyarov/bucket4j-hazelcast-4 "4.9.0"]

Dependencies

compile (2)

Group / Artifact Type Version
com.github.vladimir-bukhtoyarov : bucket4j-core jar 4.9.0
com.github.vladimir-bukhtoyarov : bucket4j-jcache jar 4.9.0

provided (2)

Group / Artifact Type Version
javax.cache : cache-api jar 1.0.0
com.hazelcast : hazelcast jar 4.0

Project Modules

There are no modules declared in this project.

Java rate-limiting library based on token-bucket algorithm.

Join the chat at https://gitter.im/vladimir-bukhtoyarov/bucket4j Licence Donate

Advantages of Bucket4j

  • Implemented on top of ideas of 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 case.
  • Absolutely non-compromise precision, Bucket4j does not operate with floats or doubles, all calculation are performed in the 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 limiting 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 hours but not often then 100 events per minute.
  • Both synchronous and asynchronous API.
  • Pluggable listener API that allows to implement monitoring and logging.
  • Ability to use bucket as a scheduler, see examples.

Supported back-ends

As mentioned above in addition to local in-memory buckets, the Bucket4j supports clustered usage scenario on top of following back-ends:

Back-end Documentation page Async supported Optimized serialization
JCache API (JSR 107) bucket4j-jcache No No
Hazelcast bucket4j-hazelcast Yes Yes
Apache Ignite bucket4j-ignite Yes n/a
Inifinispan bucket4j-infinspan Yes Yes
Oracle Coherence bucket4j-coherence Yes Yes

General documentation

Basics:

Examples:

Production checklist

  • Common production checklist - Mandatory points that need to be understood before using the Bucket4j in production, independently of local or clustered usage scenarios.
  • JCache production checklist - Mandatory points that need to be understood before using the Bucket4j over JCache cluster.

Archive:

Third-party integrations:

Third-party demos and articles:

Get Bucket4j library

You can add Bucket4j to your project as maven dependency

The Bucket4j is distributed through both JCenter and Maven Central, use any of them:

<dependency>
    <groupId>com.github.vladimir-bukhtoyarov</groupId>
    <artifactId>bucket4j-core</artifactId>
    <version>4.10.0</version>
</dependency>

You can build Bucket4j from sources

git clone https://github.com/vladimir-bukhtoyarov/bucket4j.git
cd bucket4j
mvn clean install

License

Copyright 2015-2020 Vladimir Bukhtoyarov Licensed under the Apache Software License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0.

Have a question?

Feel free to ask in:

Have a sensitive question?

If any information in the question should not be made publicly available, then try to contact with author via:

Who use Bucket4j?

Ringcentral JHipster Opentable Apereo CAS

Versions

Version
4.9.0