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.
RateLimitJ is currently provides the following plugable modules:
- Redis sliding window rate limiter
- Dropwizard integration
- Hazelcast sliding window rate limiter (in development)
- Uses an efficient sliding window algorithm for rate limiting
- Multiple limit rules per instance
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>
- RateLimitJ requires Java 8
Feature | Status |
---|---|
Redis sliding window rate limiter | Release |
Dropwizard integration - Bundle | Release |
Hazelcast sliding window rate limiter | Development |
In-memory sliding window rate limiter | Development |
Whitelisting & blacklisting of keys | not started |
Spring integration | not started |
This library was inspired by the following articles on sliding window rate limiting with Redis: