You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `spring-messaging` module of the Spring Framework provides support for RSocket requesters and responders, both on the client and on the server side.
2935
+
See the {spring-framework-docs}web-reactive.html#rsocket-spring[RSocket section] of the Spring Framework reference for more details, including an overview of the RSocket protocol.
Spring Boot provides auto-configuration for RSocket servers.
2955
+
Spring Boot provides RSocket server auto-configuration.
2978
2956
The required dependencies are provided by the `spring-boot-starter-rsocket`.
2979
2957
2980
-
Spring Boot will start an RSocket server as a new embedded server in your application, or will plug the RSocket infrastructure into an existing reactive Web server.
2958
+
Spring Boot allows exposing RSocket over WebSocket from a WebFlux server, or standing up an independent RSocket server.
2981
2959
This depends on the type of application and its configuration.
2982
2960
2983
-
In case of a WebFlux application (i.e. of type `WebApplicationType.REACTIVE`), the RSocket server will be plugged into the existing Web Server only if the following properties match:
2961
+
For WebFlux application (i.e. of type `WebApplicationType.REACTIVE`), the RSocket server will be plugged into the Web Server only if the following properties match:
@@ -3006,23 +2984,19 @@ Besides the dependency requirements, the only required configuration is to defin
3006
2984
=== Spring Messaging RSocket support
3007
2985
Spring Boot will auto-configure the Spring Messaging infrastructure for RSocket.
3008
2986
3009
-
An `RSocketStrategies` bean is created to provide encoding and decoding support for RSocket messages.
3010
-
By default, Spring Boot will try to auto-configure JSON support with Jackson for `application/json` and `"application/*+json"` media types.
3011
-
Check out the <<boot-features-json-jackson,Jackson support section>> to know more about customization possibilities.
3012
-
3013
-
Developers can create `RSocketStrategiesCustomizer` beans to add other strategies, assuming there are `Encoder` and `Decoder` implementations available.
3014
-
2987
+
This means that Spring Boot will create a `RSocketMessageHandler` bean that will handle RSocket requests to your application.
3015
2988
3016
2989
3017
2990
[[boot-features-rsocket-requester]]
3018
2991
=== Calling RSocket Services with `RSocketRequester`
3019
2992
Once the `RSocket` channel is established between server and client, any party can send or receive requests to the other.
3020
2993
3021
-
As a server, you can get injected an `RSocketRequester` instance on any handler method of an RSocket `@Controller`.
2994
+
As a server, you can get injected with an `RSocketRequester` instance on any handler method of an RSocket `@Controller`.
3022
2995
As a client, you need to configure and establish an RSocket connection first.
3023
2996
Spring Boot auto-configures an `RSocketRequester.Builder` for such cases with the expected codecs.
3024
2997
3025
-
The `RSocketRequester.Builder` instance is a prototype bean, meaning each injection point will provide you with a new instance - this is done on purpose since this builder is stateful and you shouldn't create requesters with different setups using the same instance.
2998
+
The `RSocketRequester.Builder` instance is a prototype bean, meaning each injection point will provide you with a new instance .
2999
+
This is done on purpose since this builder is stateful and you shouldn't create requesters with different setups using the same instance.
3026
3000
3027
3001
The following code shows a typical example:
3028
3002
@@ -3035,7 +3009,7 @@ The following code shows a typical example:
3035
3009
3036
3010
public MyService(RSocketRequester.Builder rsocketRequesterBuilder) {
0 commit comments