public static interface RSocketStrategies.Builder
RSocketStrategies
.Modifier and Type | Method and Description |
---|---|
RSocketStrategies |
build()
Build the
RSocketStrategies instance. |
RSocketStrategies.Builder |
dataBufferFactory(DataBufferFactory bufferFactory)
Configure the DataBufferFactory to use for allocating buffers when
preparing requests or creating responses.
|
RSocketStrategies.Builder |
decoder(Decoder<?>... decoder)
Append to the list of decoders to use for de-serializing Objects from
the data or metadata of a
Payload . |
RSocketStrategies.Builder |
decoders(Consumer<List<Decoder<?>>> consumer)
Apply the consumer to the list of configured decoders, immediately.
|
RSocketStrategies.Builder |
encoder(Encoder<?>... encoder)
Append to the list of encoders to use for serializing Objects to the
data or metadata of a
Payload . |
RSocketStrategies.Builder |
encoders(Consumer<List<Encoder<?>>> consumer)
Apply the consumer to the list of configured encoders, immediately.
|
RSocketStrategies.Builder |
metadataExtractor(MetadataExtractor metadataExtractor)
Configure a
MetadataExtractor to extract the route along with
other metadata. |
RSocketStrategies.Builder |
metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)
Apply the consumer to the
MetadataExtractorRegistry in order
to register extra metadata entry extractors. |
RSocketStrategies.Builder |
reactiveAdapterStrategy(ReactiveAdapterRegistry registry)
Configure the registry for reactive type support.
|
RSocketStrategies.Builder |
routeMatcher(RouteMatcher routeMatcher)
Configure a
RouteMatcher for matching routes to message
handlers based on route patterns. |
RSocketStrategies.Builder encoder(Encoder<?>... encoder)
Payload
.
By default this is initialized with encoders for String
,
byte[]
, ByteBuffer
, and DataBuffer
.
RSocketStrategies.Builder encoders(Consumer<List<Encoder<?>>> consumer)
RSocketStrategies.Builder decoder(Decoder<?>... decoder)
Payload
.
By default this is initialized with decoders for String
,
byte[]
, ByteBuffer
, and DataBuffer
.
RSocketStrategies.Builder decoders(Consumer<List<Decoder<?>>> consumer)
RSocketStrategies.Builder routeMatcher(@Nullable RouteMatcher routeMatcher)
RouteMatcher
for matching routes to message
handlers based on route patterns. This option is applicable to
client or server responders.
By default, SimpleRouteMatcher
is used, backed by
AntPathMatcher
with "." as separator. For better
efficiency consider switching to PathPatternRouteMatcher
from
spring-web
instead.
RSocketStrategies.Builder reactiveAdapterStrategy(@Nullable ReactiveAdapterRegistry registry)
Publisher
.
By default this ReactiveAdapterRegistry.getSharedInstance()
.
RSocketStrategies.Builder dataBufferFactory(@Nullable DataBufferFactory bufferFactory)
By default this is set to NettyDataBufferFactory
with
pooled, allocated buffers for zero copy. RSocket must also be
configured
for zero copy. For client setup, RSocketRequester.Builder
adapts automatically to the DataBufferFactory
configured
here, and sets the frame decoder in ClientRSocketFactory
accordingly. For server setup, the
ServerRSocketFactory
must be configured
accordingly for zero copy too.
If using DefaultDataBufferFactory
instead, there is no
need for related config changes in RSocket.
RSocketStrategies.Builder metadataExtractor(@Nullable MetadataExtractor metadataExtractor)
MetadataExtractor
to extract the route along with
other metadata. This option is applicable to client or server
responders.
By default this is DefaultMetadataExtractor
created with
the configured
decoders and extracting a
route from "message/x.rsocket.routing.v0"
metadata.
RSocketStrategies.Builder metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)
MetadataExtractorRegistry
in order
to register extra metadata entry extractors.RSocketStrategies build()
RSocketStrategies
instance.