Giter Club home page Giter Club logo

bucket4j's Introduction

Bucket4j - is a java implementation of token-bucket algorithm for rate limiting

Build Status Join the chat at https://gitter.im/vladimir-bukhtoyarov/bucket4j Quality Gate

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 multithreading 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.

Documentation

Examples:

Basics:

Supported back-ends without asynchronous support:

  • Jcache integration - documentation and examples about usage Bucket4j with in-memory grids which supports JCache API (JSR 107) specification.

Supported back-ends with asynchronous support:

Archieve:

Third-party integrations:

Third-party Demos:

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>3.0.2</version>
</dependency>

You can build Bucket4j from sources

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

Have a question?

Feel free to ask in the gitter chat

License

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

bucket4j's People

Contributors

bbeck avatar gitter-badger avatar jcarvalho avatar vladimir-bukhtoyarov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.