finds.dev

wangzheng0822/ratelimiter4j

Java rate limiting library/framework

View on GitHub

★ 966JavaApache-2.0updated Feb 2023

// the take

A Java library for rate limiting HTTP endpoints by app ID, supporting both in-memory (single node) and Redis-backed (distributed) fixed time window algorithms. The SPI plugin architecture lets you swap in custom rule parsers, algorithms, and config sources. Aimed at Java 8+ Spring apps that need per-API rate limits without pulling in a full gateway.

The SPI extension model is a genuine design win — you can plug in a custom rule parser or algorithm without touching library code. Zookeeper support for centralized rule management is a reasonable choice for teams already running it. The exception hierarchy (OverloadException, InvalidUrlException, InternalErrorException) is clean and makes it easy to handle throttled requests distinctly from configuration errors. Test coverage is unusually thorough for a library of this size, with integration tests and JMH benchmarks included.

Only fixed time window is implemented — no token bucket, no sliding window, no leaky bucket. Fixed window has the well-known burst problem at window boundaries and the roadmap admits this is still '未开发' (not developed) three years later. The distributed limiter uses Jedis (blocking, connection-pool-based) with no Lettuce or reactive option, which will be a friction point for anyone on Spring WebFlux. The project is effectively abandoned — last commit was February 2023, with a roadmap full of P1 items marked undone including Redis Cluster support, which means you can't use the distributed mode in any serious production Redis setup without forking it yourself.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
966
Forks
371
Language
Java
License
Apache-2.0
Last commit
20 Feb 2023

// nearby

If ratelimiter4j isn't quite it.

All repos →