Skip to content

A Java library for Rate-Limiting, providing extensible storage and application framework adaptors.

License

Notifications You must be signed in to change notification settings

mokies/ratelimitj

Repository files navigation

RateLimitJ

Build Status Maven Central Codecov 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 Stable
Dropwizard integration - Bundle Stable
Hazelcast sliding window rate limiter Development
In-memory sliding window rate limiter Development
Better metrics logging not started
Rate limiting toggles (dark launch) for framework integration Beta
Whitelisting & blacklisting of keys not started
Rate limit HTTP header responses not started
Spring integration not started

Credits

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

Background Reading

Authors