Class GraphQlWebSocketHandler.Builder
java.lang.Object
org.springframework.graphql.server.webflux.GraphQlWebSocketHandler.Builder
- Enclosing class:
GraphQlWebSocketHandler
Builder for
GraphQlWebSocketHandler.- Since:
- 2.1.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theGraphQlWebSocketHandlerinstance.corsConfiguration(@Nullable CorsConfiguration corsConfiguration) Configure the CORS configuration to use for the handshake request.keepAliveDuration(@Nullable Duration keepAliveDuration) Configure how frequently to send ping messages when no other messages are being sent.maxSubscriptionsPerSession(int maxSubscriptionsPerSession) Configure the maximum number of concurrent subscriptions a single WebSocket session is allowed to have active at a given time.
-
Method Details
-
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, ornullto skip the CORS check- Returns:
- this builder
-
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-1for no limit- Returns:
- this builder
- Since:
- 2.1.0
-
build
Build theGraphQlWebSocketHandlerinstance.
-