Add gateway-mvc: Spring Cloud Gateway Server MVC 5.1 on Boot 4.2.0 + virtual threads, retry, Redis rate limiting
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3W3uHbHAmM3orhn7b
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
7211b0fb80
commit
32086c1f5b
@@ -0,0 +1,28 @@
|
||||
# gateway-mvc
|
||||
|
||||
Spring Cloud Gateway Server MVC 5.1.0 on Spring Boot 4.2.0 / Spring Cloud 2026.0.0, JDK 25, virtual threads.
|
||||
Standalone: it has its own parent POM and is **not** part of the root build (the rest of the repo is on Boot 4.1 / Cloud 2025.1).
|
||||
|
||||
The walkthrough lives in the blog post; everything quoted there comes from `output/`.
|
||||
|
||||
| Path | What it is |
|
||||
|---|---|
|
||||
| `src/main/java/com/ankurm/gwmvc/RoutesConfig.java` | routes in the Java DSL: strip prefix, header filters, retry, rate limit, 504 mapping, a diagnostics endpoint |
|
||||
| `src/main/java/com/ankurm/gwmvc/RateLimiterConfig.java` | the `AsyncProxyManager<String>` the `rateLimit()` filter needs: Redis (Lettuce), Caffeine or none |
|
||||
| `src/main/resources/application.yml` | the YAML flavour of a route, Tomcat limited to 10 threads, virtual threads on, `platform` profile |
|
||||
| `scripts/Upstream.java` | a dependency-free backend: `/hello`, `/limited`, `/slow`, `/flaky`, `/headers` |
|
||||
| `scripts/LoadClient.java` | fires N concurrent requests and prints a status summary and elapsed time |
|
||||
| `scripts/run-all.sh` | rebuilds and regenerates every file in `output/` (needs JDK 25, Maven, `redis-server`) |
|
||||
|
||||
```bash
|
||||
mvn -DskipTests package
|
||||
java scripts/Upstream.java 9091 &
|
||||
java -jar target/gateway-mvc-1.0.0.jar --demo.store=redis # Redis on localhost:6379
|
||||
curl -i localhost:8080/api/hello
|
||||
```
|
||||
|
||||
Switches: `--demo.store=redis|caffeine|none`, `--spring.profiles.active=platform` (no virtual threads),
|
||||
`--demo.rl-timeout=300ms`, `--spring.http.clients.read-timeout=1s`,
|
||||
`--spring.cloud.gateway.server.webmvc.trusted-proxies='.*'`.
|
||||
|
||||
Timing figures (`elapsed_ms`, `time_total`) drift between runs; everything else in `output/` is deterministic.
|
||||
Reference in New Issue
Block a user