From 1df9771309d90f3aa9213e68ac59f817383722c6 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 14 Mar 2025 10:02:53 +0000 Subject: [PATCH] Create spring-boot-reactor-netty module --- settings.gradle | 1 + .../build.gradle | 1 + ...veManagementChildContextConfiguration.java | 2 +- ...iveManagementContextAutoConfiguration.java | 2 +- ...oundryWebFluxEndpointIntegrationTests.java | 2 +- ...WebFluxEndpointAccessIntegrationTests.java | 2 +- ...ndpointAdditionalPathIntegrationTests.java | 2 +- ...ngsEndpointReactiveDocumentationTests.java | 2 +- .../spring-boot-actuator/build.gradle | 2 + ...ndpointHandlerMappingIntegrationTests.java | 2 +- .../WebFluxEndpointIntegrationTests.java | 2 +- ...EndpointTestInvocationContextProvider.java | 2 +- .../netty/NettyRSocketServerFactory.java | 80 ++++++++++++++++-- .../build.gradle | 1 + .../ClientHttpConnectorAutoConfiguration.java | 2 +- .../RSocketServerAutoConfiguration.java | 6 +- .../RSocketWebSocketNettyRouteProvider.java | 2 +- .../ClientHttpConnectorAutoConfiguration.java | 2 +- ...itional-spring-configuration-metadata.json | 7 -- ...ot.autoconfigure.AutoConfiguration.imports | 1 - .../GraphQlRSocketAutoConfigurationTests.java | 4 +- ...ConfigurationReactiveIntegrationTests.java | 2 +- ...ocketWebSocketNettyRouteProviderTests.java | 2 +- ...orWebExceptionHandlerIntegrationTests.java | 2 +- .../spring-boot-dependencies/build.gradle | 1 + .../spring-boot-docs/build.gradle | 3 + .../MyNettyWebServerFactoryCustomizer.java | 2 +- .../MyNettyWebServerFactoryCustomizer.kt | 2 +- .../spring-boot-reactor-netty/build.gradle | 29 +++++++ .../server/reactive/netty/package-info.java | 0 .../reactor}/netty/CompressionCustomizer.java | 2 +- .../boot/reactor}/netty/GracefulShutdown.java | 2 +- .../netty/NettyReactiveWebServerFactory.java | 2 +- .../reactor}/netty/NettyRouteProvider.java | 2 +- .../reactor}/netty/NettyServerCustomizer.java | 2 +- .../boot/reactor}/netty/NettyWebServer.java | 2 +- .../reactor}/netty/SslServerCustomizer.java | 2 +- ...ttyReactiveWebServerAutoConfiguration.java | 10 +-- ...ttyReactiveWebServerFactoryCustomizer.java | 4 +- .../autoconfigure}/NettyServerProperties.java | 2 +- .../ReactorNettyConfigurations.java | 2 +- .../ReactorNettyProperties.java | 2 +- .../netty/autoconfigure}/package-info.java | 2 +- .../boot/reactor}/netty/package-info.java | 2 +- ...itional-spring-configuration-metadata.json | 12 +++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../NettyReactiveWebServerFactoryTests.java | 2 +- ...activeWebServerAutoConfigurationTests.java | 6 +- ...activeWebServerFactoryCustomizerTests.java | 6 +- .../NettyServerPropertiesTests.java | 2 +- .../springframework/boot/reactor}/netty/1.crt | 0 .../springframework/boot/reactor}/netty/1.key | 0 .../springframework/boot/reactor}/netty/2.crt | 0 .../springframework/boot/reactor}/netty/2.key | 0 .../boot/reactor}/netty/test.jks | Bin .../build.gradle | 2 +- .../build.gradle | 1 + 57 files changed, 174 insertions(+), 66 deletions(-) create mode 100644 spring-boot-project/spring-boot-reactor-netty/build.gradle rename spring-boot-project/{spring-boot-autoconfigure-all => spring-boot-reactor-netty}/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java (100%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/CompressionCustomizer.java (98%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/GracefulShutdown.java (97%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/NettyReactiveWebServerFactory.java (99%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/NettyRouteProvider.java (94%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/NettyServerCustomizer.java (94%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/NettyWebServer.java (99%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/SslServerCustomizer.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyReactiveWebServerAutoConfiguration.java (88%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyReactiveWebServerFactoryCustomizer.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyServerProperties.java (98%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/ReactorNettyConfigurations.java (96%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/ReactorNettyProperties.java (95%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure}/package-info.java (91%) rename spring-boot-project/{spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor}/netty/package-info.java (91%) create mode 100644 spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/additional-spring-configuration-metadata.json create mode 100644 spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename spring-boot-project/{spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor}/netty/NettyReactiveWebServerFactoryTests.java (99%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyReactiveWebServerAutoConfigurationTests.java (93%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyReactiveWebServerFactoryCustomizerTests.java (97%) rename spring-boot-project/{spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty => spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure}/NettyServerPropertiesTests.java (97%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor}/netty/1.crt (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor}/netty/1.key (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor}/netty/2.crt (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor}/netty/2.key (100%) rename spring-boot-project/{spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive => spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor}/netty/test.jks (100%) diff --git a/settings.gradle b/settings.gradle index 82fb5bc123..6a1aea8904 100644 --- a/settings.gradle +++ b/settings.gradle @@ -50,6 +50,7 @@ include "spring-boot-project:spring-boot-docker-compose" include "spring-boot-project:spring-boot-docs" include "spring-boot-project:spring-boot-jetty" include "spring-boot-project:spring-boot-parent" +include "spring-boot-project:spring-boot-reactor-netty" include "spring-boot-project:spring-boot-test" include "spring-boot-project:spring-boot-test-autoconfigure" include "spring-boot-project:spring-boot-test-integration-tests" diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle index 6a06ccbef2..785965cc78 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/build.gradle @@ -18,6 +18,7 @@ dependencies { implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") optional(project(":spring-boot-project:spring-boot-jetty")) + optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-tomcat")) optional(project(":spring-boot-project:spring-boot-undertow")) optional("ch.qos.logback:logback-classic") diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java index ad32898568..ae9cc27442 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementChildContextConfiguration.java @@ -26,8 +26,8 @@ import org.springframework.boot.actuate.autoconfigure.web.server.ManagementServe import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java index 25144fe665..dcbc932e6d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/netty/NettyReactiveManagementContextAutoConfiguration.java @@ -26,7 +26,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java index 9947dddddd..eac2600ec3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointIntegrationTests.java @@ -46,7 +46,7 @@ import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDisco import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java index 2b96964451..428b6eaa19 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointAccessIntegrationTests.java @@ -28,7 +28,7 @@ import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java index d65c3721bd..b9a37149cc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxHealthEndpointAdditionalPathIntegrationTests.java @@ -28,7 +28,7 @@ import org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointReactiveDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointReactiveDocumentationTests.java index 2e2afffb43..2d5534325b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointReactiveDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/mappings/MappingsEndpointReactiveDocumentationTests.java @@ -29,10 +29,10 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider; import org.springframework.boot.actuate.web.mappings.MappingsEndpoint; import org.springframework.boot.actuate.web.mappings.reactive.DispatcherHandlersMappingDescriptionProvider; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.server.LocalServerPort; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator/build.gradle b/spring-boot-project/spring-boot-actuator/build.gradle index eddee3102c..3e0c5f7cce 100644 --- a/spring-boot-project/spring-boot-actuator/build.gradle +++ b/spring-boot-project/spring-boot-actuator/build.gradle @@ -24,6 +24,7 @@ dependencies { dockerTestImplementation("org.testcontainers:testcontainers") optional(project(":spring-boot-project:spring-boot-jetty")) + optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-tomcat")) optional(project(":spring-boot-project:spring-boot-undertow")) optional("org.apache.cassandra:java-driver-core") { @@ -91,6 +92,7 @@ dependencies { optional("org.springframework.session:spring-session-core") testImplementation(project(":spring-boot-project:spring-boot-autoconfigure-all")) + testImplementation(project(":spring-boot-project:spring-boot-reactor-netty")) testImplementation(project(":spring-boot-project:spring-boot-test")) testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) testImplementation("io.micrometer:micrometer-observation-test") diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java index 2a67496790..883b5b7899 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java @@ -34,11 +34,11 @@ import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java index bd8f87d9f0..cad051f346 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointIntegrationTests.java @@ -27,9 +27,9 @@ import org.springframework.boot.actuate.endpoint.web.annotation.AbstractWebEndpo import org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointDiscoverer; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.reactive.context.ReactiveWebServerInitializedEvent; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java index 331adaecd3..1e4984e135 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/test/WebEndpointTestInvocationContextProvider.java @@ -55,10 +55,10 @@ import org.springframework.boot.autoconfigure.jersey.ResourceConfigCustomizer; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.boot.web.context.WebServerInitializedEvent; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java b/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java index b0c21d5e88..77d86a8d2a 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java +++ b/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactory.java @@ -22,18 +22,24 @@ import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import io.netty.handler.ssl.ClientAuth; import io.rsocket.SocketAcceptor; import io.rsocket.transport.ServerTransport; import io.rsocket.transport.netty.server.CloseableChannel; import io.rsocket.transport.netty.server.TcpServerTransport; import io.rsocket.transport.netty.server.WebsocketServerTransport; import reactor.core.publisher.Mono; +import reactor.netty.http.Http11SslContextSpec; import reactor.netty.http.server.HttpServer; +import reactor.netty.tcp.AbstractProtocolSslContextSpec; +import reactor.netty.tcp.SslProvider; import reactor.netty.tcp.SslProvider.GenericSslContextSpec; +import reactor.netty.tcp.SslProvider.SslContextSpec; import reactor.netty.tcp.TcpServer; import org.springframework.boot.context.properties.PropertyMapper; @@ -43,11 +49,10 @@ import org.springframework.boot.rsocket.server.RSocketServerCustomizer; import org.springframework.boot.rsocket.server.RSocketServerFactory; import org.springframework.boot.ssl.SslBundle; import org.springframework.boot.ssl.SslBundles; +import org.springframework.boot.ssl.SslOptions; import org.springframework.boot.web.server.Ssl; -import org.springframework.boot.web.server.Ssl.ClientAuth; import org.springframework.boot.web.server.Ssl.ServerNameSslBundle; import org.springframework.boot.web.server.WebServerSslBundle; -import org.springframework.boot.web.server.reactive.netty.SslServerCustomizer; import org.springframework.http.client.ReactorResourceFactory; import org.springframework.util.Assert; import org.springframework.util.unit.DataSize; @@ -185,7 +190,7 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur } private HttpServer customizeSslConfiguration(HttpServer httpServer) { - return new SslServerCustomizer(null, this.ssl.getClientAuth(), getSslBundle(), getServerNameSslBundles()) + return new HttpServerSslCustomizer(this.ssl.getClientAuth(), getSslBundle(), getServerNameSslBundles()) .apply(httpServer); } @@ -195,7 +200,7 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur tcpServer = tcpServer.runOn(this.resourceFactory.getLoopResources()); } if (Ssl.isEnabled(this.ssl)) { - tcpServer = new TcpSslServerCustomizer(this.ssl.getClientAuth(), getSslBundle(), getServerNameSslBundles()) + tcpServer = new TcpServerSslCustomizer(this.ssl.getClientAuth(), getSslBundle(), getServerNameSslBundles()) .apply(tcpServer); } return TcpServerTransport.create(tcpServer.bindAddress(this::getListenAddress)); @@ -222,14 +227,35 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur return new InetSocketAddress(this.port); } - private static final class TcpSslServerCustomizer - extends org.springframework.boot.web.server.reactive.netty.SslServerCustomizer { + private abstract static class SslCustomizer { + + private final ClientAuth clientAuth; + + protected SslCustomizer(ClientAuth clientAuth) { + this.clientAuth = clientAuth; + } + + protected final AbstractProtocolSslContextSpec createSslContextSpec(SslBundle sslBundle) { + AbstractProtocolSslContextSpec sslContextSpec = Http11SslContextSpec + .forServer(sslBundle.getManagers().getKeyManagerFactory()); + return sslContextSpec.configure((builder) -> { + builder.trustManager(sslBundle.getManagers().getTrustManagerFactory()); + SslOptions options = sslBundle.getOptions(); + builder.protocols(options.getEnabledProtocols()); + builder.ciphers(SslOptions.asSet(options.getCiphers())); + builder.clientAuth(this.clientAuth); + }); + } + + } + + private static final class TcpServerSslCustomizer extends SslCustomizer { private final SslBundle sslBundle; - private TcpSslServerCustomizer(ClientAuth clientAuth, SslBundle sslBundle, + private TcpServerSslCustomizer(Ssl.ClientAuth clientAuth, SslBundle sslBundle, Map serverNameSslBundles) { - super(null, clientAuth, sslBundle, serverNameSslBundles); + super(Ssl.ClientAuth.map(clientAuth, ClientAuth.NONE, ClientAuth.OPTIONAL, ClientAuth.REQUIRE)); this.sslBundle = sslBundle; } @@ -240,4 +266,42 @@ public class NettyRSocketServerFactory implements RSocketServerFactory, Configur } + private static final class HttpServerSslCustomizer extends SslCustomizer { + + private final SslProvider sslProvider; + + private final Map serverNameSslProviders; + + private HttpServerSslCustomizer(Ssl.ClientAuth clientAuth, SslBundle sslBundle, + Map serverNameSslBundles) { + super(Ssl.ClientAuth.map(clientAuth, ClientAuth.NONE, ClientAuth.OPTIONAL, ClientAuth.REQUIRE)); + this.sslProvider = createSslProvider(sslBundle); + this.serverNameSslProviders = createServerNameSslProviders(serverNameSslBundles); + } + + private HttpServer apply(HttpServer server) { + return server.secure(this::applySecurity); + } + + private void applySecurity(SslContextSpec spec) { + spec.sslContext(this.sslProvider.getSslContext()).setSniAsyncMappings((serverName, promise) -> { + SslProvider provider = (serverName != null) ? this.serverNameSslProviders.get(serverName) + : this.sslProvider; + return promise.setSuccess(provider); + }); + } + + private Map createServerNameSslProviders(Map serverNameSslBundles) { + Map serverNameSslProviders = new HashMap<>(); + serverNameSslBundles.forEach( + (serverName, sslBundle) -> serverNameSslProviders.put(serverName, createSslProvider(sslBundle))); + return serverNameSslProviders; + } + + private SslProvider createSslProvider(SslBundle sslBundle) { + return SslProvider.builder().sslContext((GenericSslContextSpec) createSslContextSpec(sslBundle)).build(); + } + + } + } diff --git a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle index ae8afb4ebf..54a742065e 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/build.gradle +++ b/spring-boot-project/spring-boot-autoconfigure-all/build.gradle @@ -42,6 +42,7 @@ dependencies { dockerTestImplementation("org.testcontainers:pulsar") dockerTestImplementation("org.testcontainers:testcontainers") + optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional(project(":spring-boot-project:spring-boot-tomcat")) optional("co.elastic.clients:elasticsearch-java") optional("com.fasterxml.jackson.core:jackson-databind") diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/client/reactive/ClientHttpConnectorAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/client/reactive/ClientHttpConnectorAutoConfiguration.java index 6a53dda229..0828407e1b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/client/reactive/ClientHttpConnectorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/http/client/reactive/ClientHttpConnectorAutoConfiguration.java @@ -26,11 +26,11 @@ 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.reactor.netty.ReactorNettyConfigurations; import org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.http.client.reactive.ClientHttpConnectorBuilder; import org.springframework.boot.http.client.reactive.ClientHttpConnectorSettings; +import org.springframework.boot.reactor.netty.autoconfigure.ReactorNettyConfigurations; import org.springframework.boot.ssl.SslBundles; import org.springframework.boot.util.LambdaSafe; import org.springframework.context.annotation.Bean; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java index 5b03571e47..1798835e60 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketServerAutoConfiguration.java @@ -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.reactor.netty.ReactorNettyConfigurations; 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.context.RSocketServerBootstrap; import org.springframework.boot.rsocket.netty.NettyRSocketServerFactory; import org.springframework.boot.rsocket.server.RSocketServerCustomizer; @@ -56,8 +56,8 @@ import org.springframework.util.unit.DataSize; * {@link EnableAutoConfiguration Auto-configuration} for RSocket servers. In the case of * {@link org.springframework.boot.WebApplicationType#REACTIVE}, the RSocket server is * added as a WebSocket endpoint on the existing - * {@link org.springframework.boot.web.server.reactive.netty.NettyWebServer}. If a - * specific server port is configured, a new standalone RSocket server is created. + * {@link org.springframework.boot.reactor.netty.NettyWebServer}. If a specific server + * port is configured, a new standalone RSocket server is created. * * @author Brian Clozel * @author Scott Frederick diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProvider.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProvider.java index 2d473e9e8c..66e883b070 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProvider.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProvider.java @@ -28,8 +28,8 @@ import reactor.netty.http.server.HttpServerRoutes; import reactor.netty.http.server.WebsocketServerSpec; import reactor.netty.http.server.WebsocketServerSpec.Builder; +import org.springframework.boot.reactor.netty.NettyRouteProvider; import org.springframework.boot.rsocket.server.RSocketServerCustomizer; -import org.springframework.boot.web.server.reactive.netty.NettyRouteProvider; /** * {@link NettyRouteProvider} that configures an RSocket Websocket endpoint. diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorAutoConfiguration.java index cfbd924178..551cab4a55 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/reactive/function/client/ClientHttpConnectorAutoConfiguration.java @@ -25,8 +25,8 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.http.client.reactive.ClientHttpConnectorBuilderCustomizer; -import org.springframework.boot.autoconfigure.reactor.netty.ReactorNettyConfigurations.ReactorResourceFactoryConfiguration; import org.springframework.boot.http.client.reactive.ReactorClientHttpConnectorBuilder; +import org.springframework.boot.reactor.netty.autoconfigure.ReactorNettyConfigurations.ReactorResourceFactoryConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 972e4ada7b..1ace67c096 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,13 +1,6 @@ { "groups": [], "properties": [ - { - "name": "server.netty.max-chunk-size", - "deprecation": { - "reason": "Deprecated for removal in Reactor Netty.", - "level": "error" - } - }, { "name": "spring.activemq.pool.create-connection-on-startup", "type": "java.lang.Boolean", diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 94f08e821f..2de6262c8c 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -132,7 +132,6 @@ org.springframework.boot.autoconfigure.web.reactive.WebSessionIdResolverAutoConf org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpConnectorAutoConfiguration org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration -org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java index a48d3200d1..326f8725fc 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/graphql/rsocket/GraphQlRSocketAutoConfigurationTests.java @@ -34,13 +34,13 @@ import org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfi 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.reactor.netty.NettyReactiveWebServerFactory; +import org.springframework.boot.reactor.netty.NettyRouteProvider; import org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.testsupport.classpath.resources.WithResource; import org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.netty.NettyRouteProvider; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.graphql.client.RSocketGraphQlClient; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java index 1471fc3cc4..8c89f3a74f 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/mustache/MustacheAutoConfigurationReactiveIntegrationTests.java @@ -27,7 +27,7 @@ import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.web.reactive.result.view.MustacheView; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java index 4da6a77aee..7e004b981d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/rsocket/RSocketWebSocketNettyRouteProviderTests.java @@ -28,11 +28,11 @@ import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; 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.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext; import org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext; import org.springframework.boot.web.server.WebServer; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java index 2863cc16c5..b5c26cb577 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTests.java @@ -37,7 +37,7 @@ import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.WebProperties; import org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration; import org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration; -import org.springframework.boot.autoconfigure.web.server.reactive.netty.NettyReactiveWebServerAutoConfiguration; +import org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration; import org.springframework.boot.test.context.assertj.AssertableReactiveWebApplicationContext; import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner; import org.springframework.boot.test.system.CapturedOutput; diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 7e30d56b02..ae89e87b6c 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1989,6 +1989,7 @@ bom { "spring-boot-loader-classic", "spring-boot-loader-tools", "spring-boot-properties-migrator", + "spring-boot-reactor-netty", "spring-boot-starter", "spring-boot-starter-activemq", "spring-boot-starter-actuator", diff --git a/spring-boot-project/spring-boot-docs/build.gradle b/spring-boot-project/spring-boot-docs/build.gradle index 5151c4d90d..aa48364c88 100644 --- a/spring-boot-project/spring-boot-docs/build.gradle +++ b/spring-boot-project/spring-boot-docs/build.gradle @@ -64,6 +64,7 @@ dependencies { autoConfiguration(project(path: ":spring-boot-project:spring-boot-autoconfigure-all", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata")) autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata")) + autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", 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-undertow", configuration: "autoConfigurationMetadata")) @@ -76,6 +77,7 @@ dependencies { configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata")) configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata")) + configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", 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")) @@ -89,6 +91,7 @@ dependencies { implementation(project(path: ":spring-boot-project:spring-boot-autoconfigure-all")) implementation(project(path: ":spring-boot-project:spring-boot-devtools")) implementation(project(path: ":spring-boot-project:spring-boot-docker-compose")) + implementation(project(path: ":spring-boot-project:spring-boot-reactor-netty")) implementation(project(path: ":spring-boot-project:spring-boot-test")) implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure")) implementation(project(path: ":spring-boot-project:spring-boot-testcontainers")) diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.java index 045ba95155..402600dbaa 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.java @@ -18,8 +18,8 @@ package org.springframework.boot.docs.web.reactive.reactiveserver.customizing.pr import java.time.Duration; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.stereotype.Component; @Component diff --git a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.kt b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.kt index 76a8f6f502..1e902bc8e9 100644 --- a/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.kt +++ b/spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/web/reactive/reactiveserver/customizing/programmatic/MyNettyWebServerFactoryCustomizer.kt @@ -17,7 +17,7 @@ package org.springframework.boot.docs.web.reactive.reactiveserver.customizing.programmatic import org.springframework.boot.web.server.WebServerFactoryCustomizer -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory import org.springframework.stereotype.Component import java.time.Duration diff --git a/spring-boot-project/spring-boot-reactor-netty/build.gradle b/spring-boot-project/spring-boot-reactor-netty/build.gradle new file mode 100644 index 0000000000..d029c46ece --- /dev/null +++ b/spring-boot-project/spring-boot-reactor-netty/build.gradle @@ -0,0 +1,29 @@ +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 Reactor Netty" + +dependencies { + api(project(":spring-boot-project:spring-boot")) + api("io.projectreactor.netty:reactor-netty-http") + api("org.springframework:spring-web") + + optional(project(":spring-boot-project:spring-boot-autoconfigure")) + + testImplementation(project(":spring-boot-project:spring-boot-test")) + testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot"))) + testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure"))) + testImplementation("io.projectreactor:reactor-test") + testImplementation("org.springframework:spring-webflux") + + testRuntimeOnly("ch.qos.logback:logback-classic") + testRuntimeOnly("org.eclipse.jetty:jetty-client") + testRuntimeOnly("org.eclipse.jetty.http2:jetty-http2-client") + testRuntimeOnly("org.eclipse.jetty.http2:jetty-http2-client-transport") +} diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java similarity index 100% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/package-info.java diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/CompressionCustomizer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/CompressionCustomizer.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/CompressionCustomizer.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/CompressionCustomizer.java index c12978d98b..f18d4bfc7e 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/CompressionCustomizer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/CompressionCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.util.Arrays; import java.util.List; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/GracefulShutdown.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/GracefulShutdown.java similarity index 97% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/GracefulShutdown.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/GracefulShutdown.java index 8d3c0d96a3..d79df7a404 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/GracefulShutdown.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/GracefulShutdown.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.time.Duration; import java.util.function.Supplier; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactory.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactory.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactory.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactory.java index f848c6887a..4cc17868e0 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactory.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.net.InetSocketAddress; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyRouteProvider.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyRouteProvider.java similarity index 94% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyRouteProvider.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyRouteProvider.java index 4c09b8a3db..40d77435a0 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyRouteProvider.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyRouteProvider.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.util.function.Function; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyServerCustomizer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyServerCustomizer.java similarity index 94% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyServerCustomizer.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyServerCustomizer.java index 742e7625a7..f7429e06a6 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyServerCustomizer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyServerCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.util.function.Function; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyWebServer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyWebServer.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyWebServer.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyWebServer.java index 682784cdbe..31735875ad 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/NettyWebServer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/NettyWebServer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.time.Duration; import java.util.Collections; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/SslServerCustomizer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/SslServerCustomizer.java similarity index 98% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/SslServerCustomizer.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/SslServerCustomizer.java index 42924e2eab..268b3f6325 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/SslServerCustomizer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/SslServerCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.util.HashMap; import java.util.Map; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfiguration.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java similarity index 88% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfiguration.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java index 9a69ed2f24..6098c5954d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import reactor.netty.http.server.HttpServer; @@ -23,14 +23,14 @@ 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.reactor.netty.ReactorNettyConfigurations.ReactorResourceFactoryConfiguration; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.autoconfigure.web.server.reactive.ReactiveWebServerConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; +import org.springframework.boot.reactor.netty.NettyRouteProvider; +import org.springframework.boot.reactor.netty.NettyServerCustomizer; +import org.springframework.boot.reactor.netty.autoconfigure.ReactorNettyConfigurations.ReactorResourceFactoryConfiguration; import org.springframework.boot.web.server.reactive.ReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.netty.NettyRouteProvider; -import org.springframework.boot.web.server.reactive.netty.NettyServerCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizer.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java index 8ce7357467..b23d54bac6 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizer.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import java.time.Duration; @@ -23,8 +23,8 @@ import io.netty.channel.ChannelOption; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.cloud.CloudPlatform; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; import org.springframework.core.Ordered; import org.springframework.core.env.Environment; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerProperties.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerProperties.java similarity index 98% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerProperties.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerProperties.java index 6687b76bfe..86134d1e2a 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerProperties.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyConfigurations.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyConfigurations.java similarity index 96% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyConfigurations.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyConfigurations.java index 3586727233..7297c59f0b 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyConfigurations.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyConfigurations.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.reactor.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyProperties.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyProperties.java similarity index 95% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyProperties.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyProperties.java index 9b4a9422fd..c0602bf1b1 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/ReactorNettyProperties.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/ReactorNettyProperties.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.reactor.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import java.time.Duration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/package-info.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/package-info.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/package-info.java index e9842ee9fc..25f33fafce 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/main/java/org/springframework/boot/autoconfigure/reactor/netty/package-info.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/autoconfigure/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for Reactor Netty. */ -package org.springframework.boot.autoconfigure.reactor.netty; +package org.springframework.boot.reactor.netty.autoconfigure; diff --git a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/package-info.java b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/package-info.java similarity index 91% rename from spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/package-info.java rename to spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/package-info.java index 96f6635163..32fdf00cf3 100644 --- a/spring-boot-project/spring-boot-all/src/main/java/org/springframework/boot/web/server/reactive/netty/package-info.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/java/org/springframework/boot/reactor/netty/package-info.java @@ -18,4 +18,4 @@ * Reactive web server implementation backed by Netty. * */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..210c211720 --- /dev/null +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,12 @@ +{ + "groups": [], + "properties": [ + { + "name": "server.netty.max-chunk-size", + "deprecation": { + "reason": "Deprecated for removal in Reactor Netty.", + "level": "error" + } + } + ] +} diff --git a/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..833645211d --- /dev/null +++ b/spring-boot-project/spring-boot-reactor-netty/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.springframework.boot.reactor.netty.autoconfigure.NettyReactiveWebServerAutoConfiguration diff --git a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactoryTests.java similarity index 99% rename from spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactoryTests.java rename to spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactoryTests.java index d21960d70c..39591e8ca4 100644 --- a/spring-boot-project/spring-boot-all/src/test/java/org/springframework/boot/web/server/reactive/netty/NettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/NettyReactiveWebServerFactoryTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.web.server.reactive.netty; +package org.springframework.boot.reactor.netty; import java.net.ConnectException; import java.net.SocketAddress; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java similarity index 93% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfigurationTests.java rename to spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java index 1c7e0615da..a4adf1e34d 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerAutoConfigurationTests.java @@ -14,15 +14,15 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import org.junit.jupiter.api.Test; import reactor.netty.http.server.HttpServer; import org.springframework.boot.autoconfigure.web.server.reactive.AbstractReactiveWebServerAutoConfigurationTests; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; +import org.springframework.boot.reactor.netty.NettyServerCustomizer; import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.netty.NettyServerCustomizer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizerTests.java rename to spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java index 4c24e99045..a3f02d1c71 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyReactiveWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import java.time.Duration; import java.util.Map; @@ -32,8 +32,8 @@ import reactor.netty.http.server.HttpServer; import org.springframework.boot.autoconfigure.web.ServerProperties; import org.springframework.boot.context.properties.source.ConfigurationPropertySources; -import org.springframework.boot.web.server.reactive.netty.NettyReactiveWebServerFactory; -import org.springframework.boot.web.server.reactive.netty.NettyServerCustomizer; +import org.springframework.boot.reactor.netty.NettyReactiveWebServerFactory; +import org.springframework.boot.reactor.netty.NettyServerCustomizer; import org.springframework.mock.env.MockEnvironment; import org.springframework.util.unit.DataSize; diff --git a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerPropertiesTests.java b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerPropertiesTests.java similarity index 97% rename from spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerPropertiesTests.java rename to spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerPropertiesTests.java index e7524e4382..a90bb36032 100644 --- a/spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/web/server/reactive/netty/NettyServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyServerPropertiesTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.autoconfigure.web.server.reactive.netty; +package org.springframework.boot.reactor.netty.autoconfigure; import java.time.Duration; import java.util.Collections; diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/1.crt b/spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/1.crt similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/1.crt rename to spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/1.crt diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/1.key b/spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/1.key similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/1.key rename to spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/1.key diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/2.crt b/spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/2.crt similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/2.crt rename to spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/2.crt diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/2.key b/spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/2.key similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/2.key rename to spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/2.key diff --git a/spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/test.jks b/spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/test.jks similarity index 100% rename from spring-boot-project/spring-boot-all/src/test/resources/org/springframework/boot/web/server/reactive/netty/test.jks rename to spring-boot-project/spring-boot-reactor-netty/src/test/resources/org/springframework/boot/reactor/netty/test.jks diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle index 9a3b34e2b4..207ddf56df 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/build.gradle @@ -5,5 +5,5 @@ plugins { description = "Starter for using Reactor Netty as the embedded reactive HTTP server." dependencies { - api("io.projectreactor.netty:reactor-netty-http") + api(project(":spring-boot-project:spring-boot-reactor-netty")) } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle index 18d5fd7424..965605773a 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/build.gradle +++ b/spring-boot-project/spring-boot-test-autoconfigure/build.gradle @@ -34,6 +34,7 @@ dependencies { dockerTestRuntimeOnly("io.lettuce:lettuce-core") dockerTestRuntimeOnly("org.springframework.data:spring-data-redis") + optional(project(":spring-boot-project:spring-boot-reactor-netty")) optional("jakarta.json.bind:jakarta.json.bind-api") optional("jakarta.persistence:jakarta.persistence-api") optional("jakarta.servlet:jakarta.servlet-api")