public static interface RSocketRequester.Builder
Modifier and Type | Method and Description |
---|---|
RSocketRequester.Builder |
apply(Consumer<RSocketRequester.Builder> configurer)
Configure this builder through a
Consumer . |
reactor.core.publisher.Mono<RSocketRequester> |
connect(io.rsocket.transport.ClientTransport transport)
Deprecated.
as of 5.3 in favor of
transport(ClientTransport) |
reactor.core.publisher.Mono<RSocketRequester> |
connectTcp(String host,
int port)
Deprecated.
as of 5.3 in favor of
tcp(String, int) |
reactor.core.publisher.Mono<RSocketRequester> |
connectWebSocket(URI uri)
Deprecated.
as of 5.3 in favor of
websocket(URI) |
RSocketRequester.Builder |
dataMimeType(org.springframework.util.MimeType mimeType)
Configure the payload data MimeType to specify on the
SETUP
frame that applies to the whole connection. |
RSocketRequester.Builder |
metadataMimeType(org.springframework.util.MimeType mimeType)
Configure the payload metadata MimeType to specify on the
SETUP
frame that applies to the whole connection. |
RSocketRequester.Builder |
rsocketConnector(RSocketConnectorConfigurer configurer)
Callback to configure the
RSocketConnector directly. |
RSocketRequester.Builder |
rsocketStrategies(Consumer<RSocketStrategies.Builder> configurer)
Customize the
RSocketStrategies . |
RSocketRequester.Builder |
rsocketStrategies(RSocketStrategies strategies)
Provide the
RSocketStrategies to use. |
RSocketRequester.Builder |
setupData(Object data)
Set the data for the setup payload.
|
RSocketRequester.Builder |
setupMetadata(Object value,
org.springframework.util.MimeType mimeType)
Add metadata entry to the setup payload.
|
RSocketRequester.Builder |
setupRoute(String route,
Object... routeVars)
Set the route for the setup payload.
|
RSocketRequester |
tcp(String host,
int port)
Build an
RSocketRequester instance for use with a TCP
transport. |
RSocketRequester |
transport(io.rsocket.transport.ClientTransport transport)
Build an
RSocketRequester instance for use with the given
transport. |
RSocketRequester |
websocket(URI uri)
Build an
RSocketRequester instance for use with a WebSocket
transport. |
RSocketRequester.Builder dataMimeType(@Nullable org.springframework.util.MimeType mimeType)
SETUP
frame that applies to the whole connection.
If not set, this will be initialized to the MimeType of the first
non-default
Decoder
, or otherwise the MimeType of the first decoder.
RSocketRequester.Builder metadataMimeType(org.springframework.util.MimeType mimeType)
SETUP
frame 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.
RSocketRequester.Builder setupData(Object data)
dataMimeType(MimeType)
.
The data be a concrete value or any producer of a single value that
can be adapted to a Publisher
via ReactiveAdapterRegistry
.
By default this is not set.
RSocketRequester.Builder setupRoute(String route, Object... routeVars)
RSocketRequester.route(String, Object...)
.
By default this is not set.
RSocketRequester.Builder setupMetadata(Object value, @Nullable org.springframework.util.MimeType mimeType)
setupRoute(String, Object...)
. The metadata value be a
concrete value or any producer of a single value that can be adapted
to a Publisher
via ReactiveAdapterRegistry
.RSocketRequester.Builder rsocketStrategies(@Nullable RSocketStrategies strategies)
RSocketStrategies
to use.
This is useful for changing the default settings, yet still allowing
further customizations via rsocketStrategies(Consumer)
.
If not set, defaults are obtained from RSocketStrategies.builder()
.
strategies
- the strategies to useRSocketRequester.Builder rsocketStrategies(Consumer<RSocketStrategies.Builder> configurer)
RSocketStrategies
.
Allows further customization on RSocketStrategies
,
mutating them if they were set
,
or starting from RSocketStrategies.builder()
defaults}.
RSocketRequester.Builder rsocketConnector(RSocketConnectorConfigurer configurer)
RSocketConnector
directly.
RSocketConnector
and will be overridden. Use the
shortcuts dataMimeType(MimeType)
and
metadataMimeType(MimeType)
on this builder instead.
DataBufferFactory
.
setupPayload
, consider using methods on this builder to specify the
route, other metadata, and data as Object values to be encoded.
RSocketMessageHandler.responder(RSocketStrategies, Object...)
.
RSocketRequester.Builder apply(Consumer<RSocketRequester.Builder> configurer)
Consumer
. This enables
libraries such as Spring Security to provide shortcuts for applying
a set of related customizations.configurer
- the configurer to applyRSocketRequester tcp(String host, int port)
RSocketRequester
instance for use with a TCP
transport. Requests are made via RSocketClient
which establishes a shared TCP connection to given host and port.host
- the host of the server to connect toport
- the port of the server to connect toRSocketRequester
RSocketRequester websocket(URI uri)
RSocketRequester
instance for use with a WebSocket
transport. Requests are made via RSocketClient
which establishes a shared WebSocket connection to given URL.uri
- the URL of the server to connect toRSocketRequester
RSocketRequester transport(io.rsocket.transport.ClientTransport transport)
RSocketRequester
instance for use with the given
transport. Requests are made via RSocketClient
which establishes a shared connection through the given transport.transport
- the transport to use for connecting to the serverRSocketRequester
@Deprecated reactor.core.publisher.Mono<RSocketRequester> connectTcp(String host, int port)
tcp(String, int)
host
- the server hostport
- the server portRSocketRequester
for the connectionTcpClientTransport
@Deprecated reactor.core.publisher.Mono<RSocketRequester> connectWebSocket(URI uri)
websocket(URI)
uri
- the RSocket server endpoint URIRSocketRequester
for the connectionWebsocketClientTransport
@Deprecated reactor.core.publisher.Mono<RSocketRequester> connect(io.rsocket.transport.ClientTransport transport)
transport(ClientTransport)
ClientTransport
.transport
- the client transport to useRSocketRequester
for the connection