0

I am creating Spring Api Gateway. One of the microservice behind use websockets to communicate with clients. When mentioned microservice returns data to the Gateway I am getting io.netty.handler.codec.http.websocketx.CorruptedWebSocketFrameException: Max frame length of 65536 has been exceeded.

I have extended the GatewayAutoConfiguration's bean webSocketService and set the maxFramePayloadLength property through ReactorNettyRequestUpgradeStrategy. I also created custom ReactorNettyWebSocketClient and override method execute to change ReactorNettyWebSocketSession's parameters. Unfortunately, it did not help.

I have found that maxFramePayloadLength property in HttpClientConnect is provided by HttpClientConfiguration and changes I have made have no effect.

Is there a way to change the default value of maxFramePayloadLength?

1 Answers1

0

You can specify this as a property in your application.properties/application.yml file, there is no need to modify anything else.

spring.cloud.gateway.httpclient.websocket.max-frame-payload-length

For reference this is the list with the Spring Cloud Gateway properties

Violeta Georgieva
  • 1,927
  • 1
  • 12
  • 13