【发布时间】:2022-01-08 06:06:24
【问题描述】:
我们有一个使用 Webclient 的 Spring 应用程序,它对外部 API 进行一些调用。 在日志中的本地环境线程名称是 [reactor-http-nio-X] :
2021-12-01 15:58:42.960 | | DEBUG 37528 --- [ctor-http-nio-5] o.s.s.w.s.u.m.OrServerWebExchangeMatcher : Trying to match using PathMatcherServerWebExchangeMatcher{pattern='/webjars/**', method=null}
2021-12-01 15:58:42.960 | | DEBUG 37528 --- [ctor-http-nio-5] athPatternParserServerWebExchangeMatcher : Request 'GET /courses' doesn't match 'null /webjars/**'
在服务器线程名称改为 [reactor-http-epoll-X] :
2021-12-01 15:58:34.462 | | DEBUG 37528 --- [ctor-http-nio-4] io.netty.handler.ssl.SslHandler : [id: 0x94714fe1, L:/192.168.0.7:60057 - ...
2021-12-01 15:58:34.463 | | INFO 37528 --- [ctor-http-nio-4] HTTP-TRACING : [id:94714fe1, L:/192.168.0.7:60057 - ...
据我了解,这种差异也会在调度程序挂钩上产生不同的行为。
我如何理解为什么线程名称(和行为)如此不同,以及如何使用 nio 线程将服务器配置为像本地机器一样工作?
【问题讨论】:
-
In my understanding this difference is also creating a different behaviour on scheduler hooks什么意思?请为该声明链接一个来源。此外,在您的问题中,链接的日志包含相同的线程名称ctor-http-nio-4和ctor-http-nio-5
标签: spring-webflux project-reactor spring-webclient reactor-netty