-1

We have a Spring application using Webclient that make some call to an external API. In local environment thread names in the log are [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/**'

In the server thread names are instead [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 - ...

In my understanding this difference is also creating a different behaviour on scheduler hooks.

How can I understand why the thread names (and behaviour) are so different and how to configure the server to behave like the local machine using nio threads?

Simon Baslé
  • 27,105
  • 5
  • 69
  • 70
lincetto
  • 972
  • 2
  • 13
  • 28
  • `In my understanding this difference is also creating a different behaviour on scheduler hooks` what do you mean? link a source please for this statement. Also, in your question, the linked logs contain the same thread name `ctor-http-nio-4` and `ctor-http-nio-5` – Toerktumlare Dec 01 '21 at 17:55

1 Answers1

1

these names reflect the fact that the underlying Netty library used on your server is the native one (Linux epoll), while your local machine is either a Mac or a Windows PC. the names should have no impact of the behavior of reactor-provided hooks, unless you have written hooks that specifically look at thread names...

Simon Baslé
  • 27,105
  • 5
  • 69
  • 70
  • Thanks Simon. I'm using this hook `Schedulers.onScheduleHook("mdc", runnable -> {` but seems not triggered in the server (Linux epoll) – lincetto Dec 02 '21 at 14:48
  • are you looking at the name of the thread in the hook? you have only shared up to the opening bracket of the lambda, which doesn't help... – Simon Baslé Dec 09 '21 at 18:18