Class GraphQlWebSocketHandler.Builder

java.lang.Object
org.springframework.graphql.server.webflux.GraphQlWebSocketHandler.Builder
Enclosing class:
GraphQlWebSocketHandler

public static final class GraphQlWebSocketHandler.Builder extends Object
Since:
2.1.0
Author:
Rossen Stoyanchev
  • Method Details

    • keepAliveDuration

      public GraphQlWebSocketHandler.Builder keepAliveDuration(@Nullable Duration keepAliveDuration)
      Configure how frequently to send ping messages when no other messages are being sent.

      By default, this is not set, and keep-alive pings are not sent.

      Parameters:
      keepAliveDuration - the keep-alive duration to use
      Returns:
      this builder
    • corsConfiguration

      public GraphQlWebSocketHandler.Builder corsConfiguration(@Nullable CorsConfiguration corsConfiguration)
      Configure the CORS configuration to use for the handshake request.

      By default, this is set to an empty CorsConfiguration.

      Parameters:
      corsConfiguration - the CORS configuration to use, or null to skip the CORS check
      Returns:
      this builder
    • maxSubscriptionsPerSession

      public GraphQlWebSocketHandler.Builder maxSubscriptionsPerSession(int maxSubscriptionsPerSession)
      Configure the maximum number of concurrent subscriptions a single WebSocket session is allowed to have active at a given time.

      By default, this is set to -1, meaning there is no limit.

      Parameters:
      maxSubscriptionsPerSession - the maximum number of concurrent subscriptions per session, or -1 for no limit
      Returns:
      this builder
      Since:
      2.1.0
    • build

      public GraphQlWebSocketHandler build()
      Build the GraphQlWebSocketHandler instance.