Interface RSocketGraphQlClient.Builder<B extends RSocketGraphQlClient.Builder<B>>
- All Superinterfaces:
GraphQlClient.Builder<B>
- Enclosing interface:
- RSocketGraphQlClient
public static interface RSocketGraphQlClient.Builder<B extends RSocketGraphQlClient.Builder<B>>
extends GraphQlClient.Builder<B>
Builder for the GraphQL over HTTP client.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theRSocketGraphQlClient
instance.clientTransport
(io.rsocket.transport.ClientTransport clientTransport) Use a givenClientTransport
to communicate with the remote server.clientTransports
(org.reactivestreams.Publisher<List<io.rsocket.loadbalance.LoadbalanceTarget>> targetPublisher, io.rsocket.loadbalance.LoadbalanceStrategy loadbalanceStrategy) Use aPublisher
ofLoadbalanceTarget
s, each of which contains aClientTransport
.dataMimeType
(MimeType dataMimeType) Customize the format of data payloads for the connection.Customize the route to specify in the metadata of each request so the server can route it to the handler for GraphQL requests.rsocketRequester
(Consumer<RSocketRequester.Builder> requester) Customize the underlyingRSocketRequester
to use.Select TCP as the underlying network protocol.Select WebSocket as the underlying network protocol.Methods inherited from interface org.springframework.graphql.client.GraphQlClient.Builder
documentSource, interceptor, interceptors
-
Method Details
-
tcp
Select TCP as the underlying network protocol. This delegates toRSocketRequester.Builder.tcp(String, int)
to create theRSocketRequester
instance.- Parameters:
host
- the remote host to connect toport
- the remote port to connect to- Returns:
- the same builder instance
-
webSocket
Select WebSocket as the underlying network protocol. This delegates toRSocketRequester.Builder.websocket(URI)
to create theRSocketRequester
instance.- Parameters:
uri
- the URL for the WebSocket handshake- Returns:
- the same builder instance
-
clientTransport
Use a givenClientTransport
to communicate with the remote server. This delegates toRSocketRequester.Builder.transport(ClientTransport)
to create theRSocketRequester
instance.- Parameters:
clientTransport
- the transport to use- Returns:
- the same builder instance
-
clientTransports
B clientTransports(org.reactivestreams.Publisher<List<io.rsocket.loadbalance.LoadbalanceTarget>> targetPublisher, io.rsocket.loadbalance.LoadbalanceStrategy loadbalanceStrategy) Use aPublisher
ofLoadbalanceTarget
s, each of which contains aClientTransport
. This delegates toRSocketRequester.Builder.transports(Publisher, LoadbalanceStrategy)
to create theRSocketRequester
instance.- Parameters:
targetPublisher
- supplies list of targets to loadbalance against; the targets are replaced when the givenPublisher
emits again.loadbalanceStrategy
- the strategy to use for selecting from the list of targets.- Returns:
- the same builder instance
- Since:
- 1.0.3
-
dataMimeType
Customize the format of data payloads for the connection.By default, this is set to
"application/graphql+json"
but it can be changed to"application/json"
if necessary.- Parameters:
dataMimeType
- the mime type to use- Returns:
- the same builder instance
-
route
Customize the route to specify in the metadata of each request so the server can route it to the handler for GraphQL requests.- Parameters:
route
- the route- Returns:
- the same builder instance
-
rsocketRequester
Customize the underlyingRSocketRequester
to use.Note that some properties of
RSocketRequester.Builder
like the data MimeType, and the underlying RSocket transport can be customized through this builder.- Returns:
- the same builder instance
- See Also:
-
build
RSocketGraphQlClient build()Build theRSocketGraphQlClient
instance.- Specified by:
build
in interfaceGraphQlClient.Builder<B extends RSocketGraphQlClient.Builder<B>>
-