Skip to content

Commit 60b1bbb

Browse files
committed
Polish "Reference Spring Framework RSocket section + polish"
See gh-18321
1 parent 9a70b5d commit 60b1bbb

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,11 +2931,8 @@ https://rsocket.io[RSocket] is a binary protocol for use on byte stream transpor
29312931
It enables symmetric interaction models via async message passing over a single connection.
29322932

29332933

2934-
The `spring-messaging` module of the Spring Framework provides support for RSocket requesters and
2935-
responders, both on the client and on the server side. See the
2936-
https://docs.spring.io/spring/docs/5.2.0.BUILD-SNAPSHOT/spring-framework-reference/web-reactive.html#rsocket-spring[RSocket section]
2937-
of the Spring Framework reference for more details, including an overview of the RSocket protocol.
2938-
2934+
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.
29392936

29402937

29412938
[[boot-features-rsocket-strategies-auto-configuration]]
@@ -2947,18 +2944,18 @@ By default, the auto-configuration will try to configure the following (in order
29472944
. JSON codecs with Jackson
29482945

29492946
The `spring-boot-starter-rsocket` starter provides both dependencies.
2947+
Check out the <<boot-features-json-jackson,Jackson support section>> to know more about customization possibilities.
29502948

29512949
Developers can customize the `RSocketStrategies` component by creating beans that implement the `RSocketStrategiesCustomizer` interface.
29522950
Note that their `@Order` is important, as it determines the order of codecs.
29532951

29542952

2955-
29562953
[[boot-features-rsocket-server-auto-configuration]]
29572954
=== RSocket server Auto-configuration
29582955
Spring Boot provides RSocket server auto-configuration.
29592956
The required dependencies are provided by the `spring-boot-starter-rsocket`.
29602957

2961-
Spring Boot allows exposing RSocket over WebSocket from a WebFlux server, or standing up an independent RSocket TCP server.
2958+
Spring Boot allows exposing RSocket over WebSocket from a WebFlux server, or standing up an independent RSocket server.
29622959
This depends on the type of application and its configuration.
29632960

29642961
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:
@@ -2972,7 +2969,7 @@ For WebFlux application (i.e. of type `WebApplicationType.REACTIVE`), the RSocke
29722969

29732970
WARNING: Plugging RSocket into a web server is only supported with Reactor Netty, as RSocket itself is built with that library.
29742971

2975-
Alternatively, an RSocket TCP server is started as an independent, embedded server.
2972+
Alternatively, an RSocket TCP or websocket server is started as an independent, embedded server.
29762973
Besides the dependency requirements, the only required configuration is to define a port for that server:
29772974

29782975
[source,properties,indent=0,subs="verbatim,quotes,attributes"]
@@ -2987,23 +2984,19 @@ Besides the dependency requirements, the only required configuration is to defin
29872984
=== Spring Messaging RSocket support
29882985
Spring Boot will auto-configure the Spring Messaging infrastructure for RSocket.
29892986

2990-
An `RSocketStrategies` bean is created to provide encoding and decoding support for RSocket messages.
2991-
By default, Spring Boot will try to auto-configure JSON support with Jackson for `application/json` and `"application/*+json"` media types.
2992-
Check out the <<boot-features-json-jackson,Jackson support section>> to know more about customization possibilities.
2993-
2994-
Developers can create `RSocketStrategiesCustomizer` beans to add other strategies, assuming there are `Encoder` and `Decoder` implementations available.
2995-
2987+
This means that Spring Boot will create a `RSocketMessageHandler` bean that will handle RSocket requests to your application.
29962988

29972989

29982990
[[boot-features-rsocket-requester]]
29992991
=== Calling RSocket Services with `RSocketRequester`
30002992
Once the `RSocket` channel is established between server and client, any party can send or receive requests to the other.
30012993

3002-
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`.
30032995
As a client, you need to configure and establish an RSocket connection first.
30042996
Spring Boot auto-configures an `RSocketRequester.Builder` for such cases with the expected codecs.
30052997

3006-
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.
30073000

30083001
The following code shows a typical example:
30093002

@@ -3016,7 +3009,7 @@ The following code shows a typical example:
30163009
30173010
public MyService(RSocketRequester.Builder rsocketRequesterBuilder) {
30183011
this.rsocketRequester = rsocketRequesterBuilder
3019-
.connectTcp("example.org", 9090).block();
3012+
.connectTcp("example.org", 9898).block();
30203013
}
30213014
30223015
public Mono<User> someRSocketCall(String name) {

0 commit comments

Comments
 (0)