1 接口响应内容过大(约4M)导致请求卡住不动
查看 gateway 日志如下:
gateway | 2023-02-22 12:27:11,015 WARN reactor.netty.channel.FluxReceive: 299 - [8fe9d3b0-4, L:/172.30.10.3:39621 ! R:172.30.10.15/172.30.10.15:8004] An exception has been observed post termination, use DEBUG level to see the full stack: io.netty.handler.codec.http.websocketx.CorruptedWebSocketFrameException: Max frame length of 10485760 has been exceeded.
2 解决
在 gateway 的 docker-compose-gateway.yaml 中 添加 environment
SPRING_CLOUD_GATEWAY_HTTPCLIENT_WEBSOCKET_MAX-FRAME-PAYLOAD-LENGTH: 512000000
执行 msctl reload gateway 重启 gateway 。