diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerAutoConfiguration.java index e96826b07f..3198b34aee 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerAutoConfiguration.java @@ -47,7 +47,10 @@ import org.springframework.util.ObjectUtils; @ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.REACTIVE) @EnableConfigurationProperties(ServerProperties.class) @Import({ReactiveWebServerAutoConfiguration.BeanPostProcessorsRegistrar.class, - ReactiveWebServerConfiguration.ReactorNettyAutoConfiguration.class}) + ReactiveWebServerConfiguration.TomcatAutoConfiguration.class, + ReactiveWebServerConfiguration.JettyAutoConfiguration.class, + ReactiveWebServerConfiguration.ReactorNettyAutoConfiguration.class, + ReactiveWebServerConfiguration.UndertowAutoConfiguration.class}) public class ReactiveWebServerAutoConfiguration { @ConditionalOnMissingBean diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerConfiguration.java index b90fe7d8ef..d6fdf28dc2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webflux/ReactiveWebServerConfiguration.java @@ -16,12 +16,16 @@ package org.springframework.boot.autoconfigure.webflux; +import io.undertow.Undertow; import reactor.ipc.netty.http.server.HttpServer; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.embedded.ReactiveWebServerFactory; +import org.springframework.boot.context.embedded.jetty.JettyReactiveWebServerFactory; import org.springframework.boot.context.embedded.reactor.ReactorNettyReactiveWebServerFactory; +import org.springframework.boot.context.embedded.tomcat.TomcatReactiveWebServerFactory; +import org.springframework.boot.context.embedded.undertow.UndertowReactiveWebServerFactory; import org.springframework.context.annotation.Bean; /** @@ -42,4 +46,32 @@ abstract class ReactiveWebServerConfiguration { } } + @ConditionalOnMissingBean(ReactiveWebServerFactory.class) + @ConditionalOnClass({org.apache.catalina.startup.Tomcat.class}) + static class TomcatAutoConfiguration { + @Bean + public TomcatReactiveWebServerFactory tomcatReactiveWebServerFactory() { + return new TomcatReactiveWebServerFactory(); + } + } + + @ConditionalOnMissingBean(ReactiveWebServerFactory.class) + @ConditionalOnClass({org.eclipse.jetty.server.Server.class}) + static class JettyAutoConfiguration { + @Bean + public JettyReactiveWebServerFactory jettyReactiveWebServerFactory() { + return new JettyReactiveWebServerFactory(); + } + } + + @ConditionalOnMissingBean(ReactiveWebServerFactory.class) + @ConditionalOnClass({Undertow.class}) + static class UndertowAutoConfiguration { + @Bean + public UndertowReactiveWebServerFactory undertowReactiveWebServerFactory() { + return new UndertowReactiveWebServerFactory(); + } + + } + }