Interface RSocketStrategies.Builder
- Enclosing interface:
- RSocketStrategies
public static interface RSocketStrategies.Builder
The builder options for creatingRSocketStrategies
.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RSocketStrategies
build()
Build theRSocketStrategies
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 aPayload
.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 aPayload
.RSocketStrategies.Builder
encoders(Consumer<List<Encoder<?>>> consumer)
Apply the consumer to the list of configured encoders, immediately.RSocketStrategies.Builder
metadataExtractor(MetadataExtractor metadataExtractor)
Configure aMetadataExtractor
to extract the route along with other metadata.RSocketStrategies.Builder
metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)
Apply the consumer to theMetadataExtractorRegistry
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 aRouteMatcher
for matching routes to message handlers based on route patterns.
Method Detail
encoder
RSocketStrategies.Builder encoder(Encoder<?>... encoder)
Append to the list of encoders to use for serializing Objects to the data or metadata of aPayload
.By default this is initialized with encoders for
String
,byte[]
,ByteBuffer
, andDataBuffer
.
encoders
RSocketStrategies.Builder encoders(Consumer<List<Encoder<?>>> consumer)
Apply the consumer to the list of configured encoders, immediately.
decoder
RSocketStrategies.Builder decoder(Decoder<?>... decoder)
Append to the list of decoders to use for de-serializing Objects from the data or metadata of aPayload
.By default this is initialized with decoders for
String
,byte[]
,ByteBuffer
, andDataBuffer
.
decoders
RSocketStrategies.Builder decoders(Consumer<List<Decoder<?>>> consumer)
Apply the consumer to the list of configured decoders, immediately.
routeMatcher
RSocketStrategies.Builder routeMatcher(@Nullable RouteMatcher routeMatcher)
Configure aRouteMatcher
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 byAntPathMatcher
with "." as separator. For better efficiency consider switching toPathPatternRouteMatcher
fromspring-web
instead.
reactiveAdapterStrategy
RSocketStrategies.Builder reactiveAdapterStrategy(@Nullable ReactiveAdapterRegistry registry)
Configure the registry for reactive type support. This can be used to to adapt to, and/or determine the semantics of a givenPublisher
.By default this
ReactiveAdapterRegistry.getSharedInstance()
.
dataBufferFactory
RSocketStrategies.Builder dataBufferFactory(@Nullable DataBufferFactory bufferFactory)
Configure the DataBufferFactory to use for allocating buffers when preparing requests or creating responses.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 theDataBufferFactory
configured here, and sets the frame decoder inRSocketConnector
accordingly. For server setup, theRSocketServer
must be configured accordingly for zero copy too.If using
DefaultDataBufferFactory
instead, there is no need for related config changes in RSocket.
metadataExtractor
RSocketStrategies.Builder metadataExtractor(@Nullable MetadataExtractor metadataExtractor)
Configure aMetadataExtractor
to extract the route along with other metadata. This option is applicable to client or server responders.By default this is
DefaultMetadataExtractor
created with theconfigured
decoders and extracting a route from"message/x.rsocket.routing.v0"
metadata.
metadataExtractorRegistry
RSocketStrategies.Builder metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)
Apply the consumer to theMetadataExtractorRegistry
in order to register extra metadata entry extractors.
build
RSocketStrategies build()
Build theRSocketStrategies
instance.