'set InputBufferSize and Timeout of connection for Netty (Reactive Spring) and heartbeats in Reactive WebSocket?

Maybe somebody has experienced this and can help me out. I have a Reactive WebSocket server (WebFlux Spring Boot). I checked the connection to the server by Postman and all is good, the connection lasts a long time, but I don't know how long this connection will last with another clients, so I want to set a couple of parameters: InputBufferSize and Timeout, I found how can do it for some servers (Jetty, TomCat,..): https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#websocket-server-runtime-configuration But I cannot find how can do it for Netty (I use Reactive WebSocket, based on Netty). How can set InputBufferSize and Timeout of connection for Netty (Reactive Spring)?

And another question is how to send ping-pong (heartbeats), I think I can do it in MyHandler (that implements org.springframework.web.reactive.socket.WebSocketHandler), in

@Override public Mono handle(WebSocketSession session)

WebSocketMessage has field type (enum: TEXT, BINARY, PING, PONG) I can use it for ping-pong (heartbeats) between any client and my server part. But many forums write that the Netty has already implemented this process (ping-pong) and it will be superfluous - to add it manually in WebSocketHandler. I'm confused here, should I write additional processing (ping-pong in WebSocketHandler) or it will be an unnecessary layer on top of the already made part in Netty?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source