forge-throttle provides deterministic, production-grade rate limiting and throttling for HTTP services.
It is designed for zero-trust environments and makes rate limiting explicit, testable, and predictable under load.
forge-throttle provides a RateLimiter abstraction and a reference filter implementation. You have two options:
Enable the provided ReferenceRateLimitingFilter by setting:
forge.rate-limit.reference.enabled=true
The filter is automatically wired in and requires no additional code. It:
HttpHeaderRateLimitKeyStrategy to extract rate limit keysIf you need custom behavior (e.g., additional logging, metrics, or key resolution), implement your own filter following the pattern of the reference implementation.
Configure rate limits in application.properties:
# Capacity per minute
rate-limit.authenticated-capacity-per-minute=100000
rate-limit.unauthenticated-capacity-per-minute=10000
# Refill rate per second
rate-limit.authenticated-refill-per-second=10000
rate-limit.unauthenticated-refill-per-second=1000
See: examples/forge-throttle for configuration examples.
See the reference implementation:
ReferenceRateLimitingFilter - A production-ready rate limiting filter implementationThis example demonstrates:
RateLimiter abstractionSee also:
RateLimitingIT - Integration tests demonstrating throttling enforcement