Interface RSocketRequester.Builder
- Enclosing interface:
- RSocketRequester
- 
Method SummaryModifier and TypeMethodDescriptionapply(Consumer<RSocketRequester.Builder> configurer) Configure this builder through aConsumer.reactor.core.publisher.Mono<RSocketRequester>connect(ClientTransport transport) Deprecated.reactor.core.publisher.Mono<RSocketRequester>connectTcp(String host, int port) Deprecated.as of 5.3 in favor oftcp(String, int)reactor.core.publisher.Mono<RSocketRequester>connectWebSocket(URI uri) Deprecated.as of 5.3 in favor ofwebsocket(URI)dataMimeType(MimeType mimeType) Configure the payload data MimeType to specify on theSETUPframe that applies to the whole connection.metadataMimeType(MimeType mimeType) Configure the payload metadata MimeType to specify on theSETUPframe that applies to the whole connection.rsocketConnector(RSocketConnectorConfigurer configurer) Callback to configure theRSocketConnectordirectly.rsocketStrategies(Consumer<RSocketStrategies.Builder> configurer) Customize theRSocketStrategies.rsocketStrategies(RSocketStrategies strategies) Provide theRSocketStrategiesto use.Set the data for the setup payload.setupMetadata(Object value, MimeType mimeType) Add metadata entry to the setup payload.setupRoute(String route, Object... routeVars) Set the route for the setup payload.Build anRSocketRequesterwith anRSocketClientthat connects over TCP to the given host and port.transport(ClientTransport transport) transports(Publisher<List<LoadbalanceTarget>> targetPublisher, LoadbalanceStrategy loadbalanceStrategy) Build anRSocketRequesterwith anLoadbalanceRSocketClientthat will connect to one of the given targets selected through the givenLoadbalanceRSocketClient.Build anRSocketRequesterwith anRSocketClientthat connects over WebSocket to the given URL.
- 
Method Details- 
dataMimeTypeConfigure the payload data MimeType to specify on theSETUPframe that applies to the whole connection.If not set, this will be initialized to the MimeType of the first non-defaultDecoder, or otherwise the MimeType of the first decoder.
- 
metadataMimeTypeConfigure the payload metadata MimeType to specify on theSETUPframe that applies to the whole connection.By default this is set to "message/x.rsocket.composite-metadata.v0"in which case the route, if provided, is encoded as a"message/x.rsocket.routing.v0"composite metadata entry. If this is set to any other MimeType, it is assumed that's the MimeType for the route, if provided.
- 
setupDataSet the data for the setup payload. The data will be encoded according to the configureddataMimeType(MimeType). The data be a concrete value or any producer of a single value that can be adapted to aPublisherviaReactiveAdapterRegistry.By default this is not set. 
- 
setupRouteSet the route for the setup payload. The rules for formatting and encoding the route are the same as those for a request route as described inRSocketRequester.route(String, Object...).By default this is not set. 
- 
setupMetadataAdd metadata entry to the setup payload. Composite metadata must be in use if this is called more than once or in addition tosetupRoute(String, Object...). The metadata value be a concrete value or any producer of a single value that can be adapted to aPublisherviaReactiveAdapterRegistry.
- 
rsocketStrategiesProvide theRSocketStrategiesto use.This is useful for changing the default settings, yet still allowing further customizations via rsocketStrategies(Consumer). If not set, defaults are obtained fromRSocketStrategies.builder().- Parameters:
- strategies- the strategies to use
 
- 
rsocketStrategiesCustomize theRSocketStrategies.Allows further customization on RSocketStrategies, mutating them if they wereset, or starting fromRSocketStrategies.builder()defaults}.
- 
rsocketConnectorCallback to configure theRSocketConnectordirectly.- The data and metadata mime types cannot be set directly
 on the RSocketConnectorand will be overridden. Use the shortcutsdataMimeType(MimeType)andmetadataMimeType(MimeType)on this builder instead.
- The frame decoder also cannot be set directly and instead is set
 to match the configured DataBufferFactory.
- For the
 setupPayload, consider using methods on this builder to specify the route, other metadata, and data as Object values to be encoded.
- To configure client side responding, see
 RSocketMessageHandler.responder(RSocketStrategies, Object...).
 - Since:
- 5.2.6
 
- The data and metadata mime types cannot be set directly
 on the 
- 
applyConfigure this builder through aConsumer. This enables libraries such as Spring Security to provide shortcuts for applying a set of related customizations.- Parameters:
- configurer- the configurer to apply
 
- 
tcpBuild anRSocketRequesterwith anRSocketClientthat connects over TCP to the given host and port. The requester can be used to make requests concurrently. Requests are made over a shared connection that is also re-established as needed when further requests are made.- Parameters:
- host- the host to connect to
- port- the port to connect to
- Returns:
- the created RSocketRequester
- Since:
- 5.3
 
- 
websocketBuild anRSocketRequesterwith anRSocketClientthat connects over WebSocket to the given URL. The requester can be used to make requests concurrently. Requests are made over a shared connection that is also re-established as needed when further requests are made.- Parameters:
- uri- the URL to connect to
- Returns:
- the created RSocketRequester
- Since:
- 5.3
 
- 
transport- Parameters:
- transport- the transport to connect with
- Returns:
- the created RSocketRequester
- Since:
- 5.3
 
- 
transportsRSocketRequester transports(Publisher<List<LoadbalanceTarget>> targetPublisher, LoadbalanceStrategy loadbalanceStrategy) Build anRSocketRequesterwith anLoadbalanceRSocketClientthat will connect to one of the given targets selected through the givenLoadbalanceRSocketClient.- Parameters:
- targetPublisher- a- Publisherthat supplies a list of target transports to loadbalance against; the given list may be periodically updated by the- Publisher.
- loadbalanceStrategy- the strategy to use for selecting from the list of loadbalance targets.
- Returns:
- the created RSocketRequester
- Since:
- 5.3
 
- 
connectTcpDeprecated.as of 5.3 in favor oftcp(String, int)Connect to the server over TCP.- Parameters:
- host- the server host
- port- the server port
- Returns:
- an RSocketRequesterfor the connection
- See Also:
- 
- TcpClientTransport
 
 
- 
connectWebSocketDeprecated.as of 5.3 in favor ofwebsocket(URI)Connect to the server over WebSocket.- Parameters:
- uri- the RSocket server endpoint URI
- Returns:
- an RSocketRequesterfor the connection
- See Also:
- 
- WebsocketClientTransport
 
 
- 
connectDeprecated.as of 5.3 in favor oftransport(ClientTransport)Connect to the server with the givenClientTransport.- Parameters:
- transport- the client transport to use
- Returns:
- an RSocketRequesterfor the connection
 
 
- 
transport(ClientTransport)