'While working with spring boot and reactive programming, I saw actor-tcp-nio in console. What does it mean?
I created a spring boot application using web flux. I logged my results in console. I saw that my method I created using Mono is executing on parallel-1 thread but I saw this actor-tcp-nio-1 in which methods of Mono are executing. What is this thread? Why doesn't it execute on parallel-1 thread.
console log
2021-04-04 23:27:04.356 INFO 7225 --- [ parallel-1] reactor.Flux.UsingWhen.1 : onSubscribe(FluxUsingWhen.UsingWhenSubscriber)
2021-04-04 23:27:04.357 INFO 7225 --- [ parallel-1] reactor.Flux.UsingWhen.1 : request(unbounded)
2021-04-04 23:27:09.730 INFO 7225 --- [actor-tcp-nio-1] reactor.Flux.UsingWhen.1 : onNext(
Solution 1:[1]
When executing a reactive chain, the thread is not guaranteed to remain the same for the entire execution. The execution thread will change depending on different operations defined in the chain, e.g. subscribeOn() and publishOn() to name a few.
By the name of it, I believe it's an RSocket library thread, whereas parallel-x is from a Reactor threadpool.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tahir Mustafa |
