New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSocket Auto-Configuration: Make RSocketWebSocketNettyRouteProvider public #18549
Comments
I've read your StackOverflow question and the former I guess this should solve the root issue, and it's probably the best way to achieve that since this processor is applied for both standalone RSocket servers and Spring WebFlux + RSocket servers. In the case of Now we need to reconsider this still - you can implement and add already as many Could you try the same with our latest 2.0.0.RC1 version and let me know if that works? |
Hi there, I don't see why the referenced issue is related. Is the reference actually correct? And version I am a bit puzzled... |
Thanks @wilkinsona and @bclozel. |
Great stuff. Thanks very much for taking the time to try it. |
Just one more little thing for consideration: In |
Good catch, @FWinkler79. Thank you. I've opened #18617. |
Used Spring Versions
Used Spring Boot Version: 2.2.0.BUILD-SNAPSHOT
Used Spring Version: 5.2
User Spring Cloud Version: Hoxton.M2
Sample Project: https://github.com/FWinkler79/SpringCloudPlatform/tree/Issue-SpringBootRsocketAutoconfig
What's the issue?
RSocketWebSocketNettyRouteProvider
is package protected and is declared inRSocketServerAutoConfiguration#WebFluxServerAutoConfiguration
as an overridable bean namedrSocketWebsocketRouteProvider
.I would like to override that bean, since for now this is the only reasonable way to configure the
ServerRSocketFactory
to add things like lease handling. See this stackoverflow question which describes the reason why I need to do it like that currently.In order to override the
rSocketWebsocketRouteProvider
bean, I either need to place my bean configuration in the same package asRSocketWebSocketNettyRouteProvider
(which then might cause all kinds of component scan issues) or I need to create a subclass of it, in the same package (which is my current solution).Generally, it is tedious having to do so, and could be avoided, if the
RSocketWebSocketNettyRouteProvider
were a public class.Expected Solution
RSocketWebSocketNettyRouteProvider
public.@Order
edServerRSocketFactoryCustomizer
beans that will be picked up to modify the auto-configuredServerRSocketFactory
(as described on stack overflow)ServerRSocketFactory
(created inRSocketWebSocketNettyRouteProvider#apply(...)
) as a bean. That would allow applications to easily add additional configurations to it.Sample Project
You can find a sample project that shows the current solution here.
To get it started, proceed as follows:
scripts/startZipkin.sh
scripts/startRabbit.sh
service-registry
config-server
rsocket-server
rsocket-client
Notice class
CustomRSocketWebSocketNettyRouteProvider
inrsocket-server
which is a subclass ofRSocketWebSocketNettyRouteProvider
and that it needs to be declared in a Spring Boot auto-config package.The text was updated successfully, but these errors were encountered: