Interface RSocketGraphQlClient.Builder<B extends RSocketGraphQlClient.Builder<B>>

Type Parameters:
B - the builder type
All Superinterfaces:
GraphQlClient.BaseBuilder<B>, 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 Type
    Method
    Description
    Build the RSocketGraphQlClient instance.
    clientTransport(io.rsocket.transport.ClientTransport clientTransport)
    Use a given ClientTransport to communicate with the remote server.
    clientTransports(org.reactivestreams.Publisher<List<io.rsocket.loadbalance.LoadbalanceTarget>> targetPublisher, io.rsocket.loadbalance.LoadbalanceStrategy loadbalanceStrategy)
    Use a Publisher of LoadbalanceTargets, each of which contains a ClientTransport.
    dataMimeType(MimeType dataMimeType)
    Customize the format of data payloads for the connection.
    route(String route)
    Customize the route to specify in the metadata of each request so the server can route it to the handler for GraphQL requests.
    Customize the underlying RSocketRequester to use.
    tcp(String host, int port)
    Select TCP as the underlying network protocol.
    Select WebSocket as the underlying network protocol.

    Methods inherited from interface org.springframework.graphql.client.GraphQlClient.BaseBuilder

    blockingTimeout, documentSource

    Methods inherited from interface org.springframework.graphql.client.GraphQlClient.Builder

    interceptor, interceptors
  • Method Details

    • tcp

      B tcp(String host, int port)
      Select TCP as the underlying network protocol. This delegates to RSocketRequester.Builder.tcp(String, int) to create the RSocketRequester instance.
      Parameters:
      host - the remote host to connect to
      port - the remote port to connect to
      Returns:
      the same builder instance
    • webSocket

      B webSocket(URI uri)
      Select WebSocket as the underlying network protocol. This delegates to RSocketRequester.Builder.websocket(URI) to create the RSocketRequester instance.
      Parameters:
      uri - the URL for the WebSocket handshake
      Returns:
      the same builder instance
    • clientTransport

      B clientTransport(io.rsocket.transport.ClientTransport clientTransport)
      Use a given ClientTransport to communicate with the remote server. This delegates to RSocketRequester.Builder.transport(ClientTransport) to create the RSocketRequester 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 a Publisher of LoadbalanceTargets, each of which contains a ClientTransport. This delegates to RSocketRequester.Builder.transports(Publisher, LoadbalanceStrategy) to create the RSocketRequester instance.
      Parameters:
      targetPublisher - supplies list of targets to loadbalance against; the targets are replaced when the given Publisher emits again.
      loadbalanceStrategy - the strategy to use for selecting from the list of targets.
      Returns:
      the same builder instance
      Since:
      1.0.3
    • dataMimeType

      B dataMimeType(MimeType 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

      B route(String 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

      B rsocketRequester(Consumer<RSocketRequester.Builder> requester)
      Customize the underlying RSocketRequester to use.

      Note that some properties of RSocketRequester.Builder like the data MimeType, and the underlying RSocket transport can be customized through this builder.

      Parameters:
      requester - the requester to be customized
      Returns:
      the same builder instance
      See Also:
    • build

      Build the RSocketGraphQlClient instance.
      Specified by:
      build in interface GraphQlClient.BaseBuilder<B extends RSocketGraphQlClient.Builder<B>>