Add rate-limiter module: fixed window, sliding log/counter, token bucket (locked and lock-free), Redis Lua limiter, Spring Boot 429 interceptor

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b4DPa89t5pSXDQHE6j
This commit is contained in:
asmhatre
2026-11-17 00:51:23 +05:30
co-authored by Claude Sonnet 5.5
parent 35ef0872de
commit deb924febd
26 changed files with 1027 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Prints the boundary-burst comparison. Needs JDK 25 and Maven.
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -B -q compile
java -cp target/classes com.ankurm.interviewlab.ratelimiter.BoundaryBurstDemo 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS'
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Starts a throwaway redis-server on 6391, runs the race demo, stops it. Needs JDK 25, Maven, redis-server.
set -euo pipefail
cd "$(dirname "$0")/.."
mvn -B -q compile dependency:build-classpath -Dmdep.outputFile=target/cp.txt >/dev/null
redis-server --port 6391 --save "" --appendonly no >/dev/null 2>&1 &
REDIS_PID=$!
trap 'kill $REDIS_PID' EXIT
sleep 1
java -cp "target/classes:$(cat target/cp.txt)" com.ankurm.interviewlab.ratelimiter.redis.RedisRaceDemo 6391 2>&1 | grep -v '^Picked up JAVA_TOOL_OPTIONS'