Remove DEFAULT_IO_WORKER_COUNT
@@ -23,7 +23,6 @@ import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory
import org.springframework.boot.web.embedded.netty.NettyServerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import reactor.netty.ReactorNetty;
import reactor.netty.http.server.HttpServer;
import reactor.netty.resources.LoopResources;
@@ -35,11 +34,6 @@ import reactor.netty.resources.LoopResources;
@Configuration
public class SoulNettyWebServerFactory {
- private static final int DEFAULT_IO_WORKER_COUNT = Integer.parseInt(System.getProperty(
- ReactorNetty.IO_WORKER_COUNT,
- "" + Math.max(Runtime.getRuntime()
- .availableProcessors() << 1, 16)));
-
/**
* Netty reactive web server factory netty reactive web server factory.
*
@@ -58,7 +52,7 @@ public class SoulNettyWebServerFactory {
public HttpServer apply(final HttpServer httpServer) {
return httpServer
.tcpConfiguration(tcpServer -> tcpServer
- .runOn(LoopResources.create("soul-netty", 1, DEFAULT_IO_WORKER_COUNT, true), false)
+ .runOn(LoopResources.create("soul-netty", 1, LoopResources.DEFAULT_IO_WORKER_COUNT, true), false)
.selectorOption(ChannelOption.SO_REUSEADDR, true)
.selectorOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT)
.option(ChannelOption.TCP_NODELAY, true)
