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
+40
View File
@@ -0,0 +1,40 @@
$ curl -i localhost:8080/api/hello
HTTP/1.1 200
X-Gateway-Thread: virtual
Content-Type: application/json
{"service":"upstream","message":"hello from the backend"}
$ curl -i localhost:8080/yaml/hello
HTTP/1.1 200
Content-Type: application/json
{"service":"upstream","message":"hello from the backend"}
$ curl -i localhost:8080/diag/thread
HTTP/1.1 200
Content-Type: application/json
{"virtual":true,"thread":"VirtualThread[#58,tomcat-handler-5]/runnable@ForkJoinPool-1-worker-1"}
# what the backend receives by default; note a client-supplied X-Forwarded-For is stripped
$ curl -s -H 'X-Forwarded-For: 1.2.3.4' localhost:8080/api/headers
accept: */*
accept-encoding: gzip,deflate
connection: Upgrade, HTTP2-Settings
host: localhost:9091
http2-settings: AAEAAEAAAAIAAAAAAAMAAAAAAAQBAAAAAAUAAEAAAAYABgAA
upgrade: h2c
user-agent: curl/8.5.0
x-gateway-route: headers
# same request with spring.cloud.gateway.server.webmvc.trusted-proxies=.*
$ curl -s -H 'X-Forwarded-For: 1.2.3.4' localhost:8080/api/headers
forwarded: proto=http;host="localhost:8080";for="127.0.0.1:41308"
x-forwarded-for: 1.2.3.4,127.0.0.1
x-forwarded-host: localhost:8080
x-forwarded-port: 8080
x-forwarded-prefix: /api
x-forwarded-proto: http
x-gateway-route: headers