Interface RSocketStrategies.Builder

Enclosing interface:
RSocketStrategies

public static interface RSocketStrategies.Builder
The builder options for creating RSocketStrategies.
  • Method Details

    • encoder

      RSocketStrategies.Builder encoder(org.springframework.core.codec.Encoder<?>... encoder)
      Append to the list of encoders to use for serializing Objects to the data or metadata of a Payload.

      By default this is initialized with encoders for String, byte[], ByteBuffer, and DataBuffer.

    • encoders

      RSocketStrategies.Builder encoders(Consumer<List<org.springframework.core.codec.Encoder<?>>> consumer)
      Apply the consumer to the list of configured encoders, immediately.
    • decoder

      RSocketStrategies.Builder decoder(org.springframework.core.codec.Decoder<?>... decoder)
      Append to the list of decoders to use for de-serializing Objects from the data or metadata of a Payload.

      By default this is initialized with decoders for String, byte[], ByteBuffer, and DataBuffer.

    • decoders

      RSocketStrategies.Builder decoders(Consumer<List<org.springframework.core.codec.Decoder<?>>> consumer)
      Apply the consumer to the list of configured decoders, immediately.
    • routeMatcher

      RSocketStrategies.Builder routeMatcher(@Nullable org.springframework.util.RouteMatcher routeMatcher)
      Configure a 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.

    • reactiveAdapterStrategy

      RSocketStrategies.Builder reactiveAdapterStrategy(@Nullable org.springframework.core.ReactiveAdapterRegistry registry)
      Configure the registry for reactive type support. This can be used to adapt to, and/or determine the semantics of a given Publisher.

      By default this ReactiveAdapterRegistry.getSharedInstance().

    • dataBufferFactory

      RSocketStrategies.Builder dataBufferFactory(@Nullable org.springframework.core.io.buffer.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 the DataBufferFactory configured here, and sets the frame decoder in RSocketConnector accordingly. For server setup, the RSocketServer 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 a 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.

    • metadataExtractorRegistry

      RSocketStrategies.Builder metadataExtractorRegistry(Consumer<MetadataExtractorRegistry> consumer)
      Apply the consumer to the MetadataExtractorRegistry in order to register extra metadata entry extractors.
    • build

      Build the RSocketStrategies instance.