Newbie alert to Spring Webflux (v 2.0.1.RELEASE).
I'd like to use Spring Webflux for a back end (Webless) application for processing a large amount of data from a JMS listener.
My understanding is Spring Webflux provides an ]non-blocking/async concurrency model. However, I got a basic question for which I need some help. As a disclaimer, this whole concept of reactive programming is very new to me and I'm still in the process of this paradigm shift.
Consider this code:
Mono.just("ONE")
.map(item -> func(" A " + item))
.map(item -> func(" B " + item))
.map(item -> func(" C " + item))
.subscribe(System.out::println);
Mono.just("TWO")
.map(item -> func(" A " + item))
.map(item -> func(" B " + item))
.map(item -> func(" C " + item))
.subscribe(System.out::println);
I understand from the docs that nothing happens to the event processing chain until a "subscribe" function is called upon.
But internally, does the spring use (if it wishes) use separate threads asynchronously for every function inside the "map" function? If spring uses a "single" thread for these chains, then what's the real purpose here? Isn't it a blocking and single threaded model based on a different syntax?
I observe that the code always behaves sequentially and with the same thread. What's the threading model of spring webflux?