Add rate-limit module: Bucket4j 8.21 token buckets on Redis in a Spring Boot 4.1 filter, per-user/per-key/global limits, 429 with Retry-After, two instances sharing one bucket

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
Claude
2026-10-28 18:27:06 +00:00
parent 99a8a0df42
commit fd0cf9b527
37 changed files with 1705 additions and 1 deletions
@@ -0,0 +1,30 @@
spring:
data:
redis:
host: localhost
port: 6379
ratelimit:
fail-open: true
config-version: 1
user:
capacity: 10
period: 1m
anonymous:
capacity: 5
period: 1m
global:
capacity: 1000
period: 1m
plans:
free:
capacity: 5
period: 1m
pro:
capacity: 20
period: 1m
api-keys:
free-key-123: free
pro-key-456: pro
costs:
"[/api/report]": 5