接口 RSocketRequester


  • public interface RSocketRequester
    A thin wrapper around a sending RSocket with a fluent API accepting and returning higher level Objects for input and for output, along with methods to prepare routing and other metadata.
    从以下版本开始:
    5.2
    作者:
    Rossen Stoyanchev, Brian Clozel
    • 方法详细资料

      • rsocket

        io.rsocket.RSocket rsocket()
        Return the underlying sending RSocket.
      • route

        RSocketRequester.RequestSpec route​(String route,
                                           Object... routeVars)
        Begin to specify a new request with the given route to a remote handler.

        The route can be a template with placeholders, e.g. "flight.{code}" in which case the supplied route variables are formatted via toString() and expanded into the template. If a formatted variable contains a "." it is replaced with the escape sequence "%2E" to avoid treating it as separator by the responder .

        If the connection is set to use composite metadata, the route is encoded as "message/x.rsocket.routing.v0". Otherwise the route is encoded according to the mime type for the connection.

        参数:
        route - the route expressing a remote handler mapping
        routeVars - variables to be expanded into the route template
        返回:
        a spec for further defining and executing the request
      • metadata

        RSocketRequester.RequestSpec metadata​(Object metadata,
                                              @Nullable
                                              MimeType mimeType)
        Begin to specify a new request with the given metadata value, which can be a concrete value or any producer of a single value that can be adapted to a Publisher via ReactiveAdapterRegistry.
        参数:
        metadata - the metadata value to encode
        mimeType - the mime type that describes the metadata; This is required for connection using composite metadata. Otherwise the value is encoded according to the mime type for the connection and this argument may be left as null.