-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support keep-alive pings in GraphQlWebSocketHandler
#534
Comments
@rstoyanchev, It would be useful to know the keep-alive duration and timeouts when we configure other parts of our system, such as the load balancer's idle timeout. It would be useful to be able to either calculate or configure the maximum length of time we could expect a websocket connection to stay idle before being closed. It seems like there would be 2 relevant durations:
|
@brandonbyskov, good point that we can skip PINGs when the session is already sending messages. For the idle read and write timeout, I was thinking that we could be more generous with read timeouts to begin with, e.g. 2 or 3 times the keep-alive period, in which case a single keep-alive duration should do. Do you agree? |
@rstoyanchev That would be good. As long as the timeout or how it's calculated is documented somewhere, so that we can calculate the maximum potential idle period. |
I just wanted to add that my company recently migrated from It looks like you have slated this for version 1.3, but do you have any suggestions in the mean time for custom code stop-gap? |
@sgrannan, looking at the auto-config, you could replace the |
As of spring-projects/spring-graphql#534, Spring for GraphQL supports the configuration of keep-alive PINGs for WebSocket connections. This commit auto-configures this value in the `GraphQlWebSocketHandler` WebFlux and MVC implementations if the `spring.graphql.websocket.keep-alive` property is configured. Closes gh-40320
Expose an additional input into
GraphQlWebSocketHandler
, probablyDuration
, that would enable periodic pings from the server to the client. This would allow detecting a lost connection or disconnected client, independent of how frequently messages are sent.Originally requested under #528.
The text was updated successfully, but these errors were encountered: