-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Auto Configure ClientRSocketConnector and ServerRsocketConnect for Spring integration RSocket #18812
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
Comments
I think we should consider to auto-configure a It really does not make sense to always instantiate a For the server side I need to think more from Spring Integration perspective. |
Related to: spring-projects/spring-boot#18812 * Extract `ServerRSocketMessageHandler` into a `public` class to allow to configure it as top-level bean and bind it into an existing server * Change `ServerRSocketConnector` to accept the mentioned external bean and don't create an internal RSocket server with an assumption that it is create externally * Add `IntegrationRSocketMessageHandler.requestMappingCompatible` option to allow to configure `ServerRSocketMessageHandler` for both Spring Integration RSocket channel adapters and regular `@MessageMapping`. This is useful for Spring Boot auto-configuration These changes give a hook to auto-configure Spring Integration RSocket channel adapters in Spring Boot
Fixes spring-projects#18812 To reuse RSocket server auto-configuration in Spring Integration, introduce an `IntegrationAutoConfiguration.IntegrationRSocketConfiguration` based on the `ServerRSocketMessageHandler` from Spring Integration which overrides an `RSocketMessagingAutoConfiguration` when SI is present on classpath. Configure a `ServerRSocketMessageHandler` from SI which is able to handle SI RSocket channel adapters and `@MessageMapping` if configured via new `IntegrationProperties.RSocket.Server.messageMappingEnabled`. Then add a `ServerRSocketConnector` which is based on the provided `ServerRSocketMessageHandler`. Also auto-configure a `ClientRSocketConnector` if `IntegrationProperties.RSocket.Client.port` or `IntegrationProperties.RSocket.Client.uri` configuration properties are present
Related to: spring-projects/spring-boot#18812 * Extract `ServerRSocketMessageHandler` into a `public` class to allow to configure it as top-level bean and bind it into an existing server * Change `ServerRSocketConnector` to accept the mentioned external bean and don't create an internal RSocket server with an assumption that it is create externally * Add `IntegrationRSocketMessageHandler.requestMappingCompatible` option to allow to configure `ServerRSocketMessageHandler` for both Spring Integration RSocket channel adapters and regular `@MessageMapping`. This is useful for Spring Boot auto-configuration These changes give a hook to auto-configure Spring Integration RSocket channel adapters in Spring Boot
Closing in favor of PR #18834 |
Hi, I have refactored my samples using Spring Boot RSocket and Spring Integration RSocket, I have some issues about interaction between them. I described it in a new question on stackoverflow. The sample codes can be found here. |
When I created a sample project to taste Spring Integration RSocket, but I have to create
ServerRSocketConnector
andClientRSocketConnector
beans. And theServerRSocketConnector
will create a new RSocket server that could cause a port binding error when running it as a standalone Spring Boot RSocket application if using the same port number.See: https://stackoverflow.com/questions/58603425/error-running-spring-integration-rsocket-sample-with-spring-boot
It is better to provide auto-configuration to detect the existing RSokcet server and create Spring Integration RSocket facilities based on the existing.
The text was updated successfully, but these errors were encountered: