Is it somehow possible to use Spring's RSocket integration in a "traditional" servlet-based Spring application without having to sacrifice functionality that Spring offers according to the documentation if you do not mix the two variants?
If so, how? Are there any pitfalls to be aware of?
The objective would be to allow an existing Servlet-based Spring application to talk to various clients over RSocket. A fully reactive experience with backpressure is neither expected nor necessary on the server side. Having to start a separate Netty-based server that runs alongside the servlet container is okay and expected.
To address questions raised in the comments, there is some functionality I am especially concerned about:
- Does declarative transaction support work for requests that come in via RSocket without having to use R2DBC? According to Reactive Transactions with Spring imperative and reactive transaction management differ significantly.
- Does Spring Security "just" work? Or is special configuration necessary, for example, to use
@PreAuthorizeon methods that are invoked by the servlet-based parts and the RSocket-based parts of the application?
@PreAuthorizeis always handled by the imperative stack.