Skip to content

Commit 9a70b5d

Browse files
rstoyanchevbclozel
authored andcommitted
Reference Spring Framework RSocket section + polish
1 parent b9cfbf7 commit 9a70b5d

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

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

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,30 +2930,11 @@ You can learn more about the resource configuration on the client side in the <<
29302930
https://rsocket.io[RSocket] is a binary protocol for use on byte stream transports.
29312931
It enables symmetric interaction models via async message passing over a single connection.
29322932

2933-
Spring Framework, with the Spring Messaging module supports RSocket both on the server and the client side.
2934-
On the server side, it lets you create special `@Controller` beans to handle incoming RSocket messages.
2935-
Methods in your controller are mapped to RSocket routes by using `@MessageMapping` annotations.
29362933

2937-
The following code shows a typical `@Controller`:
2938-
2939-
[source,java,indent=0]
2940-
----
2941-
@Controller
2942-
public class MyRSocketController {
2943-
2944-
@MessageMapping("chat.room.{name}")
2945-
public Flux<ChatMessages> enterChatRoom(@DestinationVariable String chatRoom,
2946-
Flux<ChatMessages> messages) {
2947-
// ...
2948-
}
2949-
2950-
@MessageMapping("users.\{user}.info")
2951-
Mono<ChatUserInfo> getUserInfo(@DestinationVariable String user) {
2952-
// ...
2953-
}
2954-
2955-
}
2956-
----
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.
29572938

29582939

29592940

@@ -2974,13 +2955,13 @@ Note that their `@Order` is important, as it determines the order of codecs.
29742955

29752956
[[boot-features-rsocket-server-auto-configuration]]
29762957
=== RSocket server Auto-configuration
2977-
Spring Boot provides auto-configuration for RSocket servers.
2958+
Spring Boot provides RSocket server auto-configuration.
29782959
The required dependencies are provided by the `spring-boot-starter-rsocket`.
29792960

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.
2961+
Spring Boot allows exposing RSocket over WebSocket from a WebFlux server, or standing up an independent RSocket TCP server.
29812962
This depends on the type of application and its configuration.
29822963

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:
2964+
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:
29842965

29852966
[source,properties,indent=0,subs="verbatim,quotes,attributes"]
29862967
----
@@ -2989,9 +2970,9 @@ In case of a WebFlux application (i.e. of type `WebApplicationType.REACTIVE`), t
29892970
#spring.rsocket.server.port= # no port is defined
29902971
----
29912972

2992-
WARNING: Plugging RSocket into an existing web server is only supported with Reactor Netty, as RSocket itself is built with that library.
2973+
WARNING: Plugging RSocket into a web server is only supported with Reactor Netty, as RSocket itself is built with that library.
29932974

2994-
The only other way to create an RSocket server is to start an independent, embedded RSocket server.
2975+
Alternatively, an RSocket TCP server is started as an independent, embedded server.
29952976
Besides the dependency requirements, the only required configuration is to define a port for that server:
29962977

29972978
[source,properties,indent=0,subs="verbatim,quotes,attributes"]

0 commit comments

Comments
 (0)