Using Spring Boot Weblfux with embedded Tomcat

You can exclude spring-boot-starter-reactor-netty from the spring-boot-starter-webflux dependency and use spring-boot-starter-tomcat, spring-boot-starter-undertow or spring-boot-starter-jetty instead.


If your objective is to use tomcat server then It is not necessary to exclude spring-boot-starter-reactor-netty. Adding spring boot starter tomcat will start the application in Tomcat server.

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-webflux</artifactId>
        <exclusions>
            <!-- Exclude the Netty dependency -->
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-reactor-netty</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- Use Tomcat instead -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>