Spring Boot 2.0反应式Webflux配置中的默认线程数 [英] Default number of threads in Spring boot 2.0 reactive webflux configuration

查看:2499
本文介绍了Spring Boot 2.0反应式Webflux配置中的默认线程数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Spring Boot 2.0中使用Spring 5反应式Webflux时,用于处理请求的默认线程数是多少?如何配置使用的线程数?

While using Spring 5 reactive webflux with Spring boot 2.0, what's the default number of threads used to handle requests? How can I configure the number of threads used?

推荐答案

用于请求处理的默认线程数由基础Web服务器确定;默认线程数由基础Web服务器确定.默认情况下,Spring Boot 2.0使用的是Reactor Netty,后者使用的是Netty的默认值(请参阅EventLoopGroup文档).

The default number of threads for request handling is determined by the underlying web server; by default, Spring Boot 2.0 is using Reactor Netty, which is using Netty's defaults (check out the EventLoopGroup documentation for that).

Spring Boot将很快允许您自定义该部分(请参见#10418 ).同时,您可以提供自己的ReactiveWebServerFactory bean并通过HttpServer配置选项进行更改(请参见

Spring Boot will soon allow you to customize that part (see #10418). In the meantime, you can provide your own ReactiveWebServerFactory bean and change that through the HttpServer configuration options (see this comment).

这篇关于Spring Boot 2.0反应式Webflux配置中的默认线程数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆