Browse Source

Create spring-boot-rsocket module

Closes gh-46097
pull/46230/head
Andy Wilkinson 11 months ago
parent
commit
d86d94be1b
  1. 1
      settings.gradle
  2. 2
      spring-boot-project/spring-boot-all/build.gradle
  3. 4
      spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories
  4. 1
      spring-boot-project/spring-boot-autoconfigure-all/build.gradle
  5. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfiguration.java
  6. 3
      spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/graphql/rsocket/RSocketGraphQlClientAutoConfiguration.java
  7. 6
      spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java
  8. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfiguration.java
  9. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/security/rsocket/RSocketSecurityAutoConfiguration.java
  10. 86
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  11. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  12. 6
      spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java
  13. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/RSocketGraphQlClientAutoConfigurationTests.java
  14. 8
      spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java
  15. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java
  16. 4
      spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/security/rsocket/RSocketSecurityAutoConfigurationTests.java
  17. 1
      spring-boot-project/spring-boot-dependencies/build.gradle
  18. 2
      spring-boot-project/spring-boot-docs/build.gradle
  19. 47
      spring-boot-project/spring-boot-rsocket/build.gradle
  20. 4
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessageHandlerCustomizer.java
  21. 4
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessagingAutoConfiguration.java
  22. 4
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketProperties.java
  23. 4
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketRequesterAutoConfiguration.java
  24. 6
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfiguration.java
  25. 4
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketStrategiesAutoConfiguration.java
  26. 2
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProvider.java
  27. 2
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/package-info.java
  28. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializer.java
  29. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketServerBootstrap.java
  30. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketServerInitializedEvent.java
  31. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/package-info.java
  32. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/messaging/RSocketStrategiesCustomizer.java
  33. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/messaging/package-info.java
  34. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServer.java
  35. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java
  36. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/package-info.java
  37. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/ConfigurableRSocketServerFactory.java
  38. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServer.java
  39. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerCustomizer.java
  40. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerException.java
  41. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerFactory.java
  42. 0
      spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/package-info.java
  43. 4
      spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  44. 3
      spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/spring.factories
  45. 4
      spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  46. 2
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessagingAutoConfigurationTests.java
  47. 4
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketPropertiesTests.java
  48. 2
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketRequesterAutoConfigurationTests.java
  49. 2
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java
  50. 11
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketStrategiesAutoConfigurationTests.java
  51. 35
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java
  52. 0
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializerTests.java
  53. 0
      spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java
  54. 0
      spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/autoconfigure/test.jks
  55. 0
      spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test-cert.pem
  56. 0
      spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test-key.pem
  57. 0
      spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test.jks
  58. 3
      spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/build.gradle

1
settings.gradle

@ -85,6 +85,7 @@ include "spring-boot-project:spring-boot-parent" @@ -85,6 +85,7 @@ include "spring-boot-project:spring-boot-parent"
include "spring-boot-project:spring-boot-pulsar"
include "spring-boot-project:spring-boot-r2dbc"
include "spring-boot-project:spring-boot-reactor-netty"
include "spring-boot-project:spring-boot-rsocket"
include "spring-boot-project:spring-boot-test"
include "spring-boot-project:spring-boot-test-autoconfigure"
include "spring-boot-project:spring-boot-test-integration-tests"

2
spring-boot-project/spring-boot-all/build.gradle

@ -41,8 +41,6 @@ dependencies { @@ -41,8 +41,6 @@ dependencies {
optional("io.projectreactor:reactor-tools")
optional("io.projectreactor.netty:reactor-netty-http")
optional("io.r2dbc:r2dbc-pool")
optional("io.rsocket:rsocket-core")
optional("io.rsocket:rsocket-transport-netty")
optional("io.undertow:undertow-servlet")
optional("jakarta.persistence:jakarta.persistence-api")
optional("jakarta.servlet:jakarta.servlet-api")

4
spring-boot-project/spring-boot-all/src/main/resources/META-INF/spring.factories

@ -1,7 +1,3 @@ @@ -1,7 +1,3 @@
# Application Context Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.reactor.ReactorEnvironmentPostProcessor

1
spring-boot-project/spring-boot-autoconfigure-all/build.gradle

@ -69,6 +69,7 @@ dependencies { @@ -69,6 +69,7 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-liquibase"))
optional(project(":spring-boot-project:spring-boot-r2dbc"))
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional(project(":spring-boot-project:spring-boot-rsocket"))
optional(project(":spring-boot-project:spring-boot-tomcat"))
optional(project(":spring-boot-project:spring-boot-tx"))
optional(project(":spring-boot-project:spring-boot-validation"))

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfiguration.java

@ -29,7 +29,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -29,7 +29,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.graphql.ExecutionGraphQlService;
import org.springframework.graphql.data.method.annotation.support.AnnotatedControllerConfigurer;
@ -45,7 +44,8 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa @@ -45,7 +44,8 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa
* @author Brian Clozel
* @since 2.7.0
*/
@AutoConfiguration(after = { GraphQlAutoConfiguration.class, RSocketMessagingAutoConfiguration.class })
@AutoConfiguration(after = GraphQlAutoConfiguration.class,
afterName = "org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration")
@ConditionalOnClass({ GraphQL.class, GraphQlSource.class, RSocketServer.class, HttpServer.class })
@ConditionalOnBean({ RSocketMessageHandler.class, AnnotatedControllerConfigurer.class })
@ConditionalOnProperty("spring.graphql.rsocket.mapping")

3
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/graphql/rsocket/RSocketGraphQlClientAutoConfiguration.java

@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.graphql.client.RSocketGraphQlClient;
@ -42,7 +41,7 @@ import org.springframework.util.MimeTypeUtils; @@ -42,7 +41,7 @@ import org.springframework.util.MimeTypeUtils;
* @author Brian Clozel
* @since 2.7.0
*/
@AutoConfiguration(after = RSocketRequesterAutoConfiguration.class)
@AutoConfiguration(afterName = "org.springframework.boot.rsocket.autoconfigure.RSocketRequesterAutoConfiguration")
@ConditionalOnClass({ GraphQL.class, RSocketGraphQlClient.class, RSocketRequester.class, RSocket.class,
TcpClientTransport.class })
public class RSocketGraphQlClientAutoConfiguration {

6
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.java

@ -25,7 +25,6 @@ import io.rsocket.transport.netty.server.TcpServerTransport; @@ -25,7 +25,6 @@ import io.rsocket.transport.netty.server.TcpServerTransport;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
@ -37,7 +36,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading; @@ -37,7 +36,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnThreading;
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxProperties;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.sql.init.OnDatabaseInitializationCondition;
import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
import org.springframework.boot.autoconfigure.thread.Threading;
@ -88,7 +86,8 @@ import org.springframework.util.StringUtils; @@ -88,7 +86,8 @@ import org.springframework.util.StringUtils;
* @author Yanming Zhou
* @since 1.1.0
*/
@AutoConfiguration(after = { JmxAutoConfiguration.class, TaskSchedulingAutoConfiguration.class },
@AutoConfiguration(beforeName = "org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration",
after = { JmxAutoConfiguration.class, TaskSchedulingAutoConfiguration.class },
afterName = "org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration")
@ConditionalOnClass(EnableIntegration.class)
@EnableConfigurationProperties({ IntegrationProperties.class, JmxProperties.class })
@ -310,7 +309,6 @@ public class IntegrationAutoConfiguration { @@ -310,7 +309,6 @@ public class IntegrationAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(TcpServerTransport.class)
@AutoConfigureBefore(RSocketMessagingAutoConfiguration.class)
protected static class IntegrationRSocketServerConfiguration {
@Bean

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfiguration.java

@ -31,7 +31,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean @@ -31,7 +31,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
@ -57,7 +56,8 @@ import org.springframework.util.StringUtils; @@ -57,7 +56,8 @@ import org.springframework.util.StringUtils;
* @author Madhura Bhave
* @since 2.0.0
*/
@AutoConfiguration(before = ReactiveSecurityAutoConfiguration.class, after = RSocketMessagingAutoConfiguration.class)
@AutoConfiguration(before = ReactiveSecurityAutoConfiguration.class,
afterName = "org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration")
@ConditionalOnClass({ ReactiveAuthenticationManager.class })
@ConditionalOnMissingBean(
value = { ReactiveAuthenticationManager.class, ReactiveUserDetailsService.class,

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/security/rsocket/RSocketSecurityAutoConfiguration.java

@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.security.rsocket; @@ -19,7 +19,7 @@ package org.springframework.boot.autoconfigure.security.rsocket;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessageHandlerCustomizer;
import org.springframework.boot.rsocket.autoconfigure.RSocketMessageHandlerCustomizer;
import org.springframework.boot.rsocket.server.RSocketServerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -38,7 +38,7 @@ import org.springframework.security.rsocket.core.SecuritySocketAcceptorIntercept @@ -38,7 +38,7 @@ import org.springframework.security.rsocket.core.SecuritySocketAcceptorIntercept
*/
@AutoConfiguration
@EnableRSocketSecurity
@ConditionalOnClass(SecuritySocketAcceptorInterceptor.class)
@ConditionalOnClass({ RSocketServerCustomizer.class, SecuritySocketAcceptorInterceptor.class })
public class RSocketSecurityAutoConfiguration {
@Bean

86
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -1466,92 +1466,6 @@ @@ -1466,92 +1466,6 @@
"level": "error"
}
},
{
"name": "spring.rsocket.server.ssl.bundle",
"description": "Name of a configured SSL bundle."
},
{
"name": "spring.rsocket.server.ssl.certificate",
"description": "Path to a PEM-encoded SSL certificate file."
},
{
"name": "spring.rsocket.server.ssl.certificate-private-key",
"description": "Path to a PEM-encoded private key file for the SSL certificate."
},
{
"name": "spring.rsocket.server.ssl.ciphers",
"description": "Supported SSL ciphers."
},
{
"name": "spring.rsocket.server.ssl.client-auth",
"description": "Client authentication mode. Requires a trust store."
},
{
"name": "spring.rsocket.server.ssl.enabled",
"description": "Whether to enable SSL support.",
"defaultValue": true
},
{
"name": "spring.rsocket.server.ssl.enabled-protocols",
"description": "Enabled SSL protocols."
},
{
"name": "spring.rsocket.server.ssl.key-alias",
"description": "Alias that identifies the key in the key store."
},
{
"name": "spring.rsocket.server.ssl.key-password",
"description": "Password used to access the key in the key store."
},
{
"name": "spring.rsocket.server.ssl.key-store",
"description": "Path to the key store that holds the SSL certificate (typically a jks file)."
},
{
"name": "spring.rsocket.server.ssl.key-store-password",
"description": "Password used to access the key store."
},
{
"name": "spring.rsocket.server.ssl.key-store-provider",
"description": "Provider for the key store."
},
{
"name": "spring.rsocket.server.ssl.key-store-type",
"description": "Type of the key store."
},
{
"name": "spring.rsocket.server.ssl.protocol",
"description": "SSL protocol to use.",
"defaultValue": "TLS"
},
{
"name": "spring.rsocket.server.ssl.server-name-bundles",
"description": "Mapping of host names to SSL bundles for SNI configuration."
},
{
"name": "spring.rsocket.server.ssl.trust-certificate",
"description": "Path to a PEM-encoded SSL certificate authority file."
},
{
"name": "spring.rsocket.server.ssl.trust-certificate-private-key",
"description": "Path to a PEM-encoded private key file for the SSL certificate authority."
},
{
"name": "spring.rsocket.server.ssl.trust-store",
"description": "Trust store that holds SSL certificates."
},
{
"name": "spring.rsocket.server.ssl.trust-store-password",
"description": "Password used to access the trust store."
},
{
"name": "spring.rsocket.server.ssl.trust-store-provider",
"description": "Provider for the trust store."
},
{
"name": "spring.rsocket.server.ssl.trust-store-type",
"description": "Type of the trust store."
},
{
"name": "spring.security.filter.dispatcher-types",
"defaultValue": [

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -66,10 +66,6 @@ org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration @@ -66,10 +66,6 @@ org.springframework.boot.autoconfigure.neo4j.Neo4jAutoConfiguration
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration
org.springframework.boot.autoconfigure.reactor.ReactorAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration
org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration
org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
org.springframework.boot.autoconfigure.security.servlet.SecurityFilterAutoConfiguration

6
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java

@ -27,15 +27,15 @@ import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -27,15 +27,15 @@ import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.graphql.GraphQlAutoConfiguration;
import org.springframework.boot.autoconfigure.graphql.GraphQlTestDataFetchers;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory;
import org.springframework.boot.reactor.netty.NettyRouteProvider;
import org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketServerAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.testsupport.classpath.resources.WithResource;

4
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/RSocketGraphQlClientAutoConfigurationTests.java

@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.graphql.rsocket; @@ -19,8 +19,8 @@ package org.springframework.boot.autoconfigure.graphql.rsocket;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketRequesterAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

8
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/integration/IntegrationAutoConfigurationTests.java

@ -41,10 +41,6 @@ import org.springframework.beans.PropertyAccessorFactory; @@ -41,10 +41,6 @@ import org.springframework.beans.PropertyAccessorFactory;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration.IntegrationComponentScanConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
import org.springframework.boot.context.annotation.UserConfigurations;
import org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException;
@ -54,6 +50,10 @@ import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerA @@ -54,6 +50,10 @@ import org.springframework.boot.jdbc.autoconfigure.DataSourceTransactionManagerA
import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration;
import org.springframework.boot.jdbc.autoconfigure.JdbcTemplateAutoConfiguration;
import org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer;
import org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketRequesterAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketServerAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.sql.init.DatabaseInitializationMode;
import org.springframework.boot.sql.init.DatabaseInitializationSettings;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

4
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java

@ -21,10 +21,10 @@ import java.time.Duration; @@ -21,10 +21,10 @@ import java.time.Duration;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;

4
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/security/rsocket/RSocketSecurityAutoConfigurationTests.java

@ -20,8 +20,8 @@ import io.rsocket.core.RSocketServer; @@ -20,8 +20,8 @@ import io.rsocket.core.RSocketServer;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration;
import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration;
import org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration;
import org.springframework.boot.rsocket.server.RSocketServerCustomizer;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;

1
spring-boot-project/spring-boot-dependencies/build.gradle

@ -2017,6 +2017,7 @@ bom { @@ -2017,6 +2017,7 @@ bom {
"spring-boot-pulsar",
"spring-boot-r2dbc",
"spring-boot-reactor-netty",
"spring-boot-rsocket",
"spring-boot-starter",
"spring-boot-starter-activemq",
"spring-boot-starter-actuator",

2
spring-boot-project/spring-boot-docs/build.gradle

@ -98,6 +98,7 @@ dependencies { @@ -98,6 +98,7 @@ dependencies {
autoConfiguration(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-r2dbc", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "autoConfigurationMetadata"))
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tx", configuration: "autoConfigurationMetadata"))
@ -129,6 +130,7 @@ dependencies { @@ -129,6 +130,7 @@ dependencies {
configurationProperties(project(path: ":spring-boot-project:spring-boot-pulsar", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-r2dbc", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-rsocket", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))
configurationProperties(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "configurationPropertiesMetadata"))

47
spring-boot-project/spring-boot-rsocket/build.gradle

@ -0,0 +1,47 @@ @@ -0,0 +1,47 @@
/*
* Copyright 2012-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "java-library"
id "org.springframework.boot.auto-configuration"
id "org.springframework.boot.configuration-properties"
id "org.springframework.boot.deployed"
id "org.springframework.boot.optional-dependencies"
}
description = "Spring Boot RSocket"
dependencies {
api(project(":spring-boot-project:spring-boot"))
api("io.rsocket:rsocket-core")
api("org.springframework:spring-messaging")
implementation("org.springframework:spring-web")
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-jackson"))
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
optional("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor")
optional("io.rsocket:rsocket-transport-netty")
testImplementation(project(":spring-boot-project:spring-boot-test"))
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.springframework:spring-webflux")
testRuntimeOnly("ch.qos.logback:logback-classic")
}

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketMessageHandlerCustomizer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessageHandlerCustomizer.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler;
@ -23,7 +23,7 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa @@ -23,7 +23,7 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa
*
* @author Aarti Gupta
* @author Madhura Bhave
* @since 2.3.0
* @since 4.0.0
*/
@FunctionalInterface
public interface RSocketMessageHandlerCustomizer {

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketMessagingAutoConfiguration.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessagingAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import io.rsocket.transport.netty.server.TcpServerTransport;
@ -33,7 +33,7 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa @@ -33,7 +33,7 @@ import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHa
* Messaging.
*
* @author Brian Clozel
* @since 2.2.0
* @since 4.0.0
*/
@AutoConfiguration(after = RSocketStrategiesAutoConfiguration.class)
@ConditionalOnClass({ RSocketRequester.class, io.rsocket.RSocket.class, TcpServerTransport.class })

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketProperties.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketProperties.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import java.net.InetAddress;
@ -29,7 +29,7 @@ import org.springframework.util.unit.DataSize; @@ -29,7 +29,7 @@ import org.springframework.util.unit.DataSize;
*
* @author Brian Clozel
* @author Chris Bono
* @since 2.2.0
* @since 4.0.0
*/
@ConfigurationProperties("spring.rsocket")
public class RSocketProperties {

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketRequesterAutoConfiguration.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketRequesterAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import io.rsocket.transport.netty.server.TcpServerTransport;
import reactor.netty.http.server.HttpServer;
@ -40,7 +40,7 @@ import org.springframework.messaging.rsocket.RSocketStrategies; @@ -40,7 +40,7 @@ import org.springframework.messaging.rsocket.RSocketStrategies;
* requester instances with different configurations.
*
* @author Brian Clozel
* @since 2.2.0
* @since 4.0.0
*/
@AutoConfiguration(after = RSocketStrategiesAutoConfiguration.class)
@ConditionalOnClass({ RSocketRequester.class, io.rsocket.RSocket.class, HttpServer.class, TcpServerTransport.class })

6
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import java.util.function.Consumer;
@ -33,10 +33,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -33,10 +33,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.rsocket.RSocketProperties.Server.Spec;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.properties.PropertyMapper;
import org.springframework.boot.reactor.netty.autoconfigure.ReactorNettyConfigurations;
import org.springframework.boot.rsocket.autoconfigure.RSocketProperties.Server.Spec;
import org.springframework.boot.rsocket.context.RSocketServerBootstrap;
import org.springframework.boot.rsocket.netty.NettyRSocketServerFactory;
import org.springframework.boot.rsocket.server.RSocketServerCustomizer;
@ -61,7 +61,7 @@ import org.springframework.util.unit.DataSize; @@ -61,7 +61,7 @@ import org.springframework.util.unit.DataSize;
*
* @author Brian Clozel
* @author Scott Frederick
* @since 2.2.0
* @since 4.0.0
*/
@AutoConfiguration(after = RSocketStrategiesAutoConfiguration.class)
@ConditionalOnClass({ RSocketServer.class, RSocketStrategies.class, HttpServer.class, TcpServerTransport.class })

4
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketStrategiesAutoConfiguration.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketStrategiesAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
@ -39,7 +39,7 @@ import org.springframework.web.util.pattern.PathPatternRouteMatcher; @@ -39,7 +39,7 @@ import org.springframework.web.util.pattern.PathPatternRouteMatcher;
* {@link EnableAutoConfiguration Auto-configuration} for {@link RSocketStrategies}.
*
* @author Brian Clozel
* @since 2.2.0
* @since 4.0.0
*/
@AutoConfiguration(afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
@ConditionalOnClass({ io.rsocket.RSocket.class, RSocketStrategies.class, PooledByteBufAllocator.class })

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProvider.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProvider.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import java.util.List;
import java.util.function.Consumer;

2
spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/package-info.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/autoconfigure/package-info.java

@ -17,4 +17,4 @@ @@ -17,4 +17,4 @@
/**
* Auto-configuration for RSocket.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/context/RSocketServerBootstrap.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketServerBootstrap.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/context/RSocketServerInitializedEvent.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/RSocketServerInitializedEvent.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/context/package-info.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/context/package-info.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/messaging/RSocketStrategiesCustomizer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/messaging/RSocketStrategiesCustomizer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/messaging/package-info.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/messaging/package-info.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/package-info.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/netty/package-info.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/ConfigurableRSocketServerFactory.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/ConfigurableRSocketServerFactory.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/RSocketServer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/RSocketServerCustomizer.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerCustomizer.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/RSocketServerException.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerException.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/RSocketServerFactory.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/RSocketServerFactory.java

0
spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/server/package-info.java → spring-boot-project/spring-boot-rsocket/src/main/java/org/springframework/boot/rsocket/server/package-info.java

4
spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
{
"properties": [
]
}

3
spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/spring.factories

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
# Application Context Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer

4
spring-boot-project/spring-boot-rsocket/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
org.springframework.boot.rsocket.autoconfigure.RSocketMessagingAutoConfiguration
org.springframework.boot.rsocket.autoconfigure.RSocketRequesterAutoConfiguration
org.springframework.boot.rsocket.autoconfigure.RSocketServerAutoConfiguration
org.springframework.boot.rsocket.autoconfigure.RSocketStrategiesAutoConfiguration

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketMessagingAutoConfigurationTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketMessagingAutoConfigurationTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import org.junit.jupiter.api.Test;

4
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketPropertiesTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketPropertiesTests.java

@ -14,12 +14,12 @@ @@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import org.junit.jupiter.api.Test;
import reactor.netty.http.server.WebsocketServerSpec;
import org.springframework.boot.autoconfigure.rsocket.RSocketProperties.Server.Spec;
import org.springframework.boot.rsocket.autoconfigure.RSocketProperties.Server.Spec;
import static org.assertj.core.api.Assertions.assertThat;

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketRequesterAutoConfigurationTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketRequesterAutoConfigurationTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.jupiter.api.Test;

2
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfigurationTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

11
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketStrategiesAutoConfigurationTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketStrategiesAutoConfigurationTests.java

@ -14,12 +14,12 @@ @@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.rsocket.messaging.RSocketStrategiesCustomizer;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
@ -41,8 +41,11 @@ import static org.mockito.Mockito.mock; @@ -41,8 +41,11 @@ import static org.mockito.Mockito.mock;
*/
class RSocketStrategiesAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().withConfiguration(
AutoConfigurations.of(JacksonAutoConfiguration.class, RSocketStrategiesAutoConfiguration.class));
@SuppressWarnings("removal")
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(RSocketStrategiesAutoConfiguration.class))
.withBean(org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.class)
.withBean(ObjectMapper.class);
@Test
@SuppressWarnings("removal")

35
spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketWebSocketNettyRouteProviderTests.java

@ -14,20 +14,18 @@ @@ -14,20 +14,18 @@
* limitations under the License.
*/
package org.springframework.boot.autoconfigure.rsocket;
package org.springframework.boot.rsocket.autoconfigure;
import java.net.URI;
import java.time.Duration;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration;
import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration;
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener;
import org.springframework.boot.logging.LogLevel;
import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext;
@ -37,12 +35,15 @@ import org.springframework.context.ApplicationContext; @@ -37,12 +35,15 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.stereotype.Controller;
import org.springframework.test.web.reactive.server.WebTestClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;
import static org.assertj.core.api.Assertions.assertThat;
@ -56,14 +57,13 @@ class RSocketWebSocketNettyRouteProviderTests { @@ -56,14 +57,13 @@ class RSocketWebSocketNettyRouteProviderTests {
@Test
void webEndpointsShouldWork() {
new ReactiveWebApplicationContextRunner(AnnotationConfigReactiveWebServerApplicationContext::new)
.withConfiguration(AutoConfigurations.of(HttpHandlerAutoConfiguration.class, WebFluxAutoConfiguration.class,
ErrorWebFluxAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class,
JacksonAutoConfiguration.class, CodecsAutoConfiguration.class,
.withConfiguration(AutoConfigurations.of(PropertyPlaceholderAutoConfiguration.class,
RSocketStrategiesAutoConfiguration.class, RSocketServerAutoConfiguration.class,
RSocketMessagingAutoConfiguration.class, RSocketRequesterAutoConfiguration.class))
.withUserConfiguration(WebConfiguration.class)
.withPropertyValues("spring.rsocket.server.transport=websocket",
"spring.rsocket.server.mapping-path=/rsocket")
.withInitializer(ConditionEvaluationReportLoggingListener.forLogLevel(LogLevel.INFO))
.run((context) -> {
ReactiveWebServerApplicationContext serverContext = (ReactiveWebServerApplicationContext) context
.getSourceApplicationContext();
@ -99,9 +99,15 @@ class RSocketWebSocketNettyRouteProviderTests { @@ -99,9 +99,15 @@ class RSocketWebSocketNettyRouteProviderTests {
.websocket(URI.create("ws://localhost:" + port + "/rsocket"));
}
@EnableWebFlux
@Configuration(proxyBeanMethods = false)
static class WebConfiguration {
@Bean
HttpHandler httpHandler(ApplicationContext context) {
return WebHttpHandlerBuilder.applicationContext(context).build();
}
@Bean
WebController webController() {
return new WebController();
@ -114,6 +120,17 @@ class RSocketWebSocketNettyRouteProviderTests { @@ -114,6 +120,17 @@ class RSocketWebSocketNettyRouteProviderTests {
return serverFactory;
}
@Bean
ObjectMapper objectMapper() {
return new ObjectMapper();
}
@Bean
@SuppressWarnings({ "removal", "deprecation" })
org.springframework.http.converter.json.Jackson2ObjectMapperBuilder objectMapperBuilder() {
return new org.springframework.http.converter.json.Jackson2ObjectMapperBuilder();
}
}
@Controller

0
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializerTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/context/RSocketPortInfoApplicationContextInitializerTests.java

0
spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java → spring-boot-project/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java

0
spring-boot-project/spring-boot-autoconfigure-all/src/test/resources/org/springframework/boot/autoconfigure/rsocket/test.jks → spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/autoconfigure/test.jks

0
spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/rsocket/netty/test-cert.pem → spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test-cert.pem

0
spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/rsocket/netty/test-key.pem → spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test-key.pem

0
spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/rsocket/netty/test.jks → spring-boot-project/spring-boot-rsocket/src/test/resources/org/springframework/boot/rsocket/netty/test.jks

3
spring-boot-project/spring-boot-starters/spring-boot-starter-rsocket/build.gradle

@ -21,11 +21,10 @@ plugins { @@ -21,11 +21,10 @@ plugins {
description = "Starter for building RSocket clients and servers"
dependencies {
api(project(":spring-boot-project:spring-boot-rsocket"))
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-json"))
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-reactor-netty"))
api("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor")
api("io.rsocket:rsocket-core")
api("io.rsocket:rsocket-transport-netty")
api("org.springframework:spring-messaging")
}

Loading…
Cancel
Save