When using the spring-boot-starter-web and spring-boot-starter-rsocket and using these settings:

spring:
  rsocket:
    server:
      transport: websocket
      mapping-path: /rsocket

Connecting with an RSocket client yields this error:

21:33:13.910 WARN [reactor-http-nio-4] [id: 0x2d4c451e, L:/127.0.0.1:60219 - R:localhost/127.0.0.1:8080] The connection observed an error
io.netty.handler.codec.http.websocketx.WebSocketHandshakeException: Invalid handshake response getStatus: 404

I'd expect it to work as it with spring-boot-starter-webflux does or at least some hint in the documentation (for the RSocketProperties) or an exception at startup.

Comment From: bclozel

Indeed, the websocket transport will only work with a WebFlux application powered by Reactor Netty. We should make that more obvious and fail hard if developers are trying to use it with another combination.

Comment From: bclozel

I've changed my mind.

I think the current situation is comparable to when an application has both spring-boot-starter-web and spring-boot-starter-webflux. The application probably wants to start a Spring MVC app and use a WebClient in it. In that case, using WebFlux specific properties does not fail the application nor prints warnings.

Having both spring-boot-starter-web and spring-boot-starter-rsocket is totally valid if the application wants to use an RSocketRequester within a Spring MVC application.

I think we should update the documentation section "RSocket server Auto-configuration" to underline the fact that the RSocket over websocket in an existing web server only works with a Reactor Netty instance.

Comment From: maxim-bandurko-lsvt

@bclozel Hello. Have a question, coming from RSocket over websocket in an existing web server only works with a Reactor Netty instance, how implementation can look like? Like this vanilla example https://github.com/hantsy/rsocket-sample/tree/master/vanilla but only for websocket, or may be it is possible to make it similar to webflux starter? Thanks

Comment From: izeye

This seems to be a documentation issue in the end, so the label seems to need to be updated accordingly.

Comment From: wilkinsona

Thanks @izeye. I've updated the label and the release notes.

Comment From: rrileyca

I have both spring-boot-starter-web (which is brought in by spring-boot-starter-websocket) and spring-boot-starter-web on the classpath. I am getting the same 404 error. How does one make this work?

Comment From: bclozel

@rrileyca I think you should ask a question on StackOverflow and share more details there.