es.moki.ratelimitj

The RateLimitJ project aims to provide a modular rate limiting solution

License

License

GroupId

GroupId

es.moki.ratelimitj
ArtifactId

ArtifactId

ratelimitj-inmemory
Last Version

Last Version

0.7.0
Release Date

Release Date

Type

Type

jar
Description

Description

es.moki.ratelimitj
The RateLimitJ project aims to provide a modular rate limiting solution
Project URL

Project URL

https://github.com/mokies/ratelimitj
Source Code Management

Source Code Management

https://github.com/mokies/ratelimitj.git

Download ratelimitj-inmemory

How to add to project

<!-- https://jarcasting.com/artifacts/es.moki.ratelimitj/ratelimitj-inmemory/ -->
<dependency>
    <groupId>es.moki.ratelimitj</groupId>
    <artifactId>ratelimitj-inmemory</artifactId>
    <version>0.7.0</version>
</dependency>
// https://jarcasting.com/artifacts/es.moki.ratelimitj/ratelimitj-inmemory/
implementation 'es.moki.ratelimitj:ratelimitj-inmemory:0.7.0'
// https://jarcasting.com/artifacts/es.moki.ratelimitj/ratelimitj-inmemory/
implementation ("es.moki.ratelimitj:ratelimitj-inmemory:0.7.0")
'es.moki.ratelimitj:ratelimitj-inmemory:jar:0.7.0'
<dependency org="es.moki.ratelimitj" name="ratelimitj-inmemory" rev="0.7.0">
  <artifact name="ratelimitj-inmemory" type="jar" />
</dependency>
@Grapes(
@Grab(group='es.moki.ratelimitj', module='ratelimitj-inmemory', version='0.7.0')
)
libraryDependencies += "es.moki.ratelimitj" % "ratelimitj-inmemory" % "0.7.0"
[es.moki.ratelimitj/ratelimitj-inmemory "0.7.0"]

Dependencies

compile (1)

Group / Artifact Type Version
es.moki.ratelimitj : ratelimitj-core jar 0.7.0

runtime (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.30
net.jodah : expiringmap jar 0.5.8
de.jkeylockmanager : jkeylockmanager jar 2.1.0

test (6)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.7.1
ratelimitj » ratelimitj-test jar unspecified
org.assertj : assertj-core jar 3.15.0
com.google.guava : guava jar 30.1.1-jre
org.mockito : mockito-junit-jupiter jar 3.3.3
ch.qos.logback : logback-classic jar 1.2.3

Project Modules

There are no modules declared in this project.

RateLimitJ Logo

RateLimitJ

Build Status Codecov Maven Central license

A Java library for rate limiting, assembled using extensible storage and application framework adaptors. The library's interfaces support thread-safe sync, async, and reactive usage patterns.

Modules

RateLimitJ provides the following stable plugable modules:

Features

  • Uses an efficient approximated sliding window algorithm for rate limiting
  • Multiple limit rules per instance

Binaries/Download

Binaries and dependency information for Maven, Ivy, Gradle and others can be found at Maven Central.

Example for Maven:

<dependency>
  <groupId>es.moki.ratelimitj</groupId>
  <artifactId>ratelimitj-redis</artifactId>
  <version>${ratelimitj-redis.version}</version>
</dependency>

Prerequisite

  • RateLimitJ requires Java 8

Roadmap

Feature Status
Redis sliding window rate limiter production
Dropwizard integration - Bundle production
In-memory sliding window rate limiter stable
In-memory concurrent rate limiter beta
Rate limiting toggles (dark launch) for framework integration beta
Hazelcast sliding window rate limiter beta/dev
Redis concurrent rate limiter dev/active
Enhanced metrics logging back log
Whitelisting & blacklisting of keys back log
Rate limit HTTP header responses back log
Async in-memory rate limit buffer/cache (inspired by Google's SRE book) back log
Spring integration back log

Building

RateLimitJ is built with Gradle and requires docker to spin up Redis for the Redis module.

To build:

$ git clone https://github.com/mokies/ratelimitj.git
$ cd ratelimij/
$ ./gradlew

Credits

This library was inspired by the following articles on sliding window rate limiting with Redis:

Background Reading

Authors

Versions

Version
0.7.0
0.7.0-RC1
0.6.0
0.5.0
0.4.4
0.4.2
0.4.1
0.4.0
0.4.0.M2
0.4.0.M1
0.3.3
0.3.2