simple example to understand the thread flow.
[gshp subscribedOn-1] INFO reactor.Flux.FlatMap.1 -onSubscribe(FluxFlatMap.FlatMapMain)
[gshp publishOn-7] INFO reactor.Flux.FlatMap.1 - onNext(6)
Here reactor.Flux.FlatMap.1 is common for both gshp subscribedOn-1, gshp publishOn-7
When we run java, it starts with main thread after that what happens, will it creating gshp subscribedOn-1 or reactor.Flux.FlatMap.1?
@Test
public void setUpTestTest() {
Scheduler scheduler1 = Schedulers.newParallel("gshp subscribedOn", 3);
Scheduler scheduler2 = Schedulers.newParallel("gshp publishOn", 6);
Flux<String> flux = Flux.range(1, 200)
.flatMap(s-> Flux.just(""+s)
.publishOn(scheduler2)
.concatMap(d->processMessagefluxpause(d, "test")))
.log()
.subscribeOn(scheduler1);
StepVerifier.create(flux).expectNextCount(20).verifyComplete();
}