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:
asmhatre
2026-11-26 00:55:16 +05:30
co-authored by Claude Sonnet 5.5
parent 7211b0fb80
commit 32086c1f5b
19 changed files with 821 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
## A. read timeout: spring.http.clients.read-timeout=1s, backend sleeps 3s
$ curl -i localhost:8080/api/slow?ms=3000
HTTP/1.1 500
Content-Type: application/json
{"timestamp":"2026-11-25T19:23:31.069Z","status":500,"error":"Internal Server Error","path":"/api/slow"}
# log line behind that 500:
Request processing failed: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:9091/slow"
## B. same timeout, route with onError(ResourceAccessException) mapped to 504
$ curl -i localhost:8080/api/slow-mapped?ms=3000
HTTP/1.1 504
Content-Type: application/json
{"error":"upstream did not answer in time"}
## C. Redis stops while the gateway is up; no timeout configured on rateLimit()
$ curl --max-time 5 -H 'X-Api-Key: dave' localhost:8080/api/limited
curl exit after 5.001396s, http_code=000
## D. same outage, with demo.rl-timeout=300ms (setTimeout on the filter)
$ curl -H 'X-Api-Key: dave' localhost:8080/api/limited
http_code=500 time_total_under_1s=yes
# log line behind that 500:
Request processing failed: java.util.concurrent.TimeoutException
# Redis back: the next request works again, no restart needed
http_code=200
## E. no AsyncProxyManager bean at all (--demo.store=none)
$ curl -i -H 'X-Api-Key: erin' localhost:8080/api/limited
HTTP/1.1 500
Content-Type: application/json
{"timestamp":"2026-11-25T19:24:09.127Z","status":500,"error":"Internal Server Error","path":"/api/limited"}
# log line behind that 500:
Request processing failed: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.github.bucket4j.distributed.proxy.AsyncProxyManager<?>' available