Class GraphQlSseHandler.Builder

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

public static final class GraphQlSseHandler.Builder extends Object
Builder for GraphQlSseHandler.
Since:
2.1.0
Author:
Brian Clozel, Rossen Stoyanchev
  • Method Details

    • timeout

      public GraphQlSseHandler.Builder timeout(@Nullable Duration timeout)
      Set a timeout on how long to wait for the application to return the ServerResponse that will start the stream.
      Parameters:
      timeout - the timeout value, or null to never time out
    • keepAliveDuration

      public GraphQlSseHandler.Builder keepAliveDuration(@Nullable Duration keepAliveDuration)
      Set a keep-alive duration that determines how frequently to send heartbeats during periods of inactivity.
      Parameters:
      keepAliveDuration - how frequently to send empty comment messages when no other messages are sent
    • httpMethods

      public GraphQlSseHandler.Builder httpMethods(HttpMethod... httpMethods)
      Set the HTTP methods that the handler should support.

      By default, only HttpMethod.POST is supported. Enabling HttpMethod.GET allows clients such as the browser EventSource API, which can only issue GET requests, to use this endpoint.

      Parameters:
      httpMethods - the HTTP methods to support
    • build

      public GraphQlSseHandler build()