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
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Regenerates every file under output/.
#
# ./scripts/run-all.sh
#
# Needs a JDK 25, Maven 3.9 and redis-server and redis-cli (7.x) on the PATH. The tests start
# throwaway redis-server processes on free ports and stop them when the JVM exits; they never touch
# a Redis on 6379. Transcripts 00-07 come out of the test suite, so each number in them is an
# assertion that fails the build if it stops being true. Transcript 08 is two real JVMs and curl.
set -euo pipefail
cd "$(dirname "$0")/.."
mkdir -p output
echo "== test suite (transcripts 00-07)"
mvn -B test | tee /tmp/rate-limit-mvn.log | grep -E '^\[(INFO|WARNING|ERROR)\] Tests run:' | sed 's/^\[[A-Z]*\] //' > output/00-test-summary.txt
echo "== two real JVMs (transcript 08)"
./scripts/two-jvms.sh >/dev/null
echo
echo "output:"
ls -1 output