Spring boot 运行springboot应用程序时(使用Spring5),如何配置apache nio属性?

Spring boot 运行springboot应用程序时(使用Spring5),如何配置apache nio属性?,spring-boot,nio,Spring Boot,Nio,我们正在使用新的被动功能运行springboot应用程序。对于下游呼叫,我们使用spring提供的新WebClient。当我们配置max threads时,我们会尊重这种配置。我们想尝试使用额外的轮询器线程或更改一些超时。但是,不支持nio特定的apache配置 非常感谢您的帮助 在application.properties中 server.tomcat.max-threads=3 <- this is working server.tomcat.accept-count=1000 &l

我们正在使用新的被动功能运行springboot应用程序。对于下游呼叫,我们使用spring提供的新WebClient。当我们配置max threads时,我们会尊重这种配置。我们想尝试使用额外的轮询器线程或更改一些超时。但是,不支持nio特定的apache配置

非常感谢您的帮助

在application.properties中

server.tomcat.max-threads=3 <- this is working
server.tomcat.accept-count=1000 <- this is working
server.tomcat.poller-thread-count=5 <- this is not working/ignored
server.tomcat.poller-thread-priority=5 <- this is not working/ignored
server.tomcat.selector-timeout=2000 <- this is not working/ignored

server.tomcat.max threads=3可以配置tomcat使用的连接器,例如NIO连接器
通过提供您自己的定制程序:

@Bean
    public EmbeddedServletContainerFactory servletContainerFactory() {
        TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();

        factory.addConnectorCustomizers(connector -> 
        ((AbstractProtocol) connector.getProtocolHandler()).setMaxConnections(200));


        // configure some more properties

        return factory;
    }
}
你也可以阅读: