|
|
|
@ -2,7 +2,7 @@ |
|
|
|
= RSocket |
|
|
|
= RSocket |
|
|
|
:gh-rsocket: https://github.com/rsocket |
|
|
|
:gh-rsocket: https://github.com/rsocket |
|
|
|
:gh-rsocket-java: {gh-rsocket}/rsocket-java |
|
|
|
:gh-rsocket-java: {gh-rsocket}/rsocket-java |
|
|
|
:gh-rsocket-extentions: {gh-rsocket}/rsocket/blob/master/Extensions |
|
|
|
:gh-rsocket-extensions: {gh-rsocket}/rsocket/blob/master/Extensions |
|
|
|
|
|
|
|
|
|
|
|
This section describes Spring Framework's support for the RSocket protocol. |
|
|
|
This section describes Spring Framework's support for the RSocket protocol. |
|
|
|
|
|
|
|
|
|
|
|
@ -99,9 +99,9 @@ and therefore only included in the first message on a request, i.e. with one of |
|
|
|
|
|
|
|
|
|
|
|
Protocol extensions define common metadata formats for use in applications: |
|
|
|
Protocol extensions define common metadata formats for use in applications: |
|
|
|
|
|
|
|
|
|
|
|
* {gh-rsocket-extentions}/CompositeMetadata.md[Composite Metadata]-- multiple, |
|
|
|
* {gh-rsocket-extensions}/CompositeMetadata.md[Composite Metadata]-- multiple, |
|
|
|
independently formatted metadata entries. |
|
|
|
independently formatted metadata entries. |
|
|
|
* {gh-rsocket-extentions}/Routing.md[Routing] -- the route for a request. |
|
|
|
* {gh-rsocket-extensions}/Routing.md[Routing] -- the route for a request. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -218,7 +218,7 @@ established transparently and used. |
|
|
|
|
|
|
|
|
|
|
|
For data, the default mime type is derived from the first configured `Decoder`. For |
|
|
|
For data, the default mime type is derived from the first configured `Decoder`. For |
|
|
|
metadata, the default mime type is |
|
|
|
metadata, the default mime type is |
|
|
|
{gh-rsocket-extentions}/CompositeMetadata.md[composite metadata] which allows multiple |
|
|
|
{gh-rsocket-extensions}/CompositeMetadata.md[composite metadata] which allows multiple |
|
|
|
metadata value and mime type pairs per request. Typically both don't need to be changed. |
|
|
|
metadata value and mime type pairs per request. Typically both don't need to be changed. |
|
|
|
|
|
|
|
|
|
|
|
Data and metadata in the `SETUP` frame is optional. On the server side, |
|
|
|
Data and metadata in the `SETUP` frame is optional. On the server side, |
|
|
|
@ -291,7 +291,7 @@ infrastructure that's used on a server, but registered programmatically as follo |
|
|
|
---- |
|
|
|
---- |
|
|
|
<1> Use `PathPatternRouteMatcher`, if `spring-web` is present, for efficient |
|
|
|
<1> Use `PathPatternRouteMatcher`, if `spring-web` is present, for efficient |
|
|
|
route matching. |
|
|
|
route matching. |
|
|
|
<2> Create a responder from a class with `@MessageMaping` and/or `@ConnectMapping` methods. |
|
|
|
<2> Create a responder from a class with `@MessageMapping` and/or `@ConnectMapping` methods. |
|
|
|
<3> Register the responder. |
|
|
|
<3> Register the responder. |
|
|
|
|
|
|
|
|
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] |
|
|
|
@ -310,7 +310,7 @@ infrastructure that's used on a server, but registered programmatically as follo |
|
|
|
---- |
|
|
|
---- |
|
|
|
<1> Use `PathPatternRouteMatcher`, if `spring-web` is present, for efficient |
|
|
|
<1> Use `PathPatternRouteMatcher`, if `spring-web` is present, for efficient |
|
|
|
route matching. |
|
|
|
route matching. |
|
|
|
<2> Create a responder from a class with `@MessageMaping` and/or `@ConnectMapping` methods. |
|
|
|
<2> Create a responder from a class with `@MessageMapping` and/or `@ConnectMapping` methods. |
|
|
|
<3> Register the responder. |
|
|
|
<3> Register the responder. |
|
|
|
|
|
|
|
|
|
|
|
Note the above is only a shortcut designed for programmatic registration of client |
|
|
|
Note the above is only a shortcut designed for programmatic registration of client |
|
|
|
@ -494,7 +494,7 @@ The `data(Object)` step is optional. Skip it for requests that don't send data: |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
Extra metadata values can be added if using |
|
|
|
Extra metadata values can be added if using |
|
|
|
{gh-rsocket-extentions}/CompositeMetadata.md[composite metadata] (the default) and if the |
|
|
|
{gh-rsocket-extensions}/CompositeMetadata.md[composite metadata] (the default) and if the |
|
|
|
values are supported by a registered `Encoder`. For example: |
|
|
|
values are supported by a registered `Encoder`. For example: |
|
|
|
|
|
|
|
|
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
[source,java,indent=0,subs="verbatim,quotes",role="primary"] |
|
|
|
@ -605,8 +605,8 @@ Then start an RSocket server through the Java RSocket API and plug the |
|
|
|
---- |
|
|
|
---- |
|
|
|
|
|
|
|
|
|
|
|
`RSocketMessageHandler` supports |
|
|
|
`RSocketMessageHandler` supports |
|
|
|
{gh-rsocket-extentions}/CompositeMetadata.md[composite] and |
|
|
|
{gh-rsocket-extensions}/CompositeMetadata.md[composite] and |
|
|
|
{gh-rsocket-extentions}/Routing.md[routing] metadata by default. You can set its |
|
|
|
{gh-rsocket-extensions}/Routing.md[routing] metadata by default. You can set its |
|
|
|
<<rsocket-metadata-extractor>> if you need to switch to a |
|
|
|
<<rsocket-metadata-extractor>> if you need to switch to a |
|
|
|
different mime type or register additional metadata mime types. |
|
|
|
different mime type or register additional metadata mime types. |
|
|
|
|
|
|
|
|
|
|
|
@ -821,7 +821,7 @@ requests to the `RSocketRequester` for the connection. See |
|
|
|
== MetadataExtractor |
|
|
|
== MetadataExtractor |
|
|
|
|
|
|
|
|
|
|
|
Responders must interpret metadata. |
|
|
|
Responders must interpret metadata. |
|
|
|
{gh-rsocket-extentions}/CompositeMetadata.md[Composite metadata] allows independently |
|
|
|
{gh-rsocket-extensions}/CompositeMetadata.md[Composite metadata] allows independently |
|
|
|
formatted metadata values (e.g. for routing, security, tracing) each with its own mime |
|
|
|
formatted metadata values (e.g. for routing, security, tracing) each with its own mime |
|
|
|
type. Applications need a way to configure metadata mime types to support, and a way |
|
|
|
type. Applications need a way to configure metadata mime types to support, and a way |
|
|
|
to access extracted values. |
|
|
|
to access extracted values. |
|
|
|
@ -832,7 +832,7 @@ in annotated handler methods. |
|
|
|
|
|
|
|
|
|
|
|
`DefaultMetadataExtractor` can be given `Decoder` instances to decode metadata. Out of |
|
|
|
`DefaultMetadataExtractor` can be given `Decoder` instances to decode metadata. Out of |
|
|
|
the box it has built-in support for |
|
|
|
the box it has built-in support for |
|
|
|
{gh-rsocket-extentions}/Routing.md["message/x.rsocket.routing.v0"] which it decodes to |
|
|
|
{gh-rsocket-extensions}/Routing.md["message/x.rsocket.routing.v0"] which it decodes to |
|
|
|
`String` and saves under the "route" key. For any other mime type you'll need to provide |
|
|
|
`String` and saves under the "route" key. For any other mime type you'll need to provide |
|
|
|
a `Decoder` and register the mime type as follows: |
|
|
|
a `Decoder` and register the mime type as follows: |
|
|
|
|
|
|
|
|
|
|
|
|