Class GraphQlSseHandler.Builder
java.lang.Object
org.springframework.graphql.server.webflux.GraphQlSseHandler.Builder
- Enclosing class:
GraphQlSseHandler
Builder for
GraphQlSseHandler.- Since:
- 2.1.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theGraphQlSseHandler.httpMethods(HttpMethod... httpMethods) Set the HTTP methods that the handler should support.keepAliveDuration(@Nullable Duration keepAliveDuration) Set a keep-alive duration that determines how frequently to send heartbeats during periods of inactivity.Set a timeout on how long to wait for the application to return theServerResponsethat will start the stream.
-
Method Details
-
timeout
Set a timeout on how long to wait for the application to return theServerResponsethat will start the stream.- Parameters:
timeout- the timeout value, ornullto never time out
-
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
Set the HTTP methods that the handler should support.By default, only
HttpMethod.POSTis supported. EnablingHttpMethod.GETallows clients such as the browserEventSourceAPI, which can only issue GET requests, to use this endpoint.- Parameters:
httpMethods- the HTTP methods to support
-
build
Build theGraphQlSseHandler.
-