Код: Выделить всё
Flux.fromIterable(idList)
.parallel()
.runOn(Schedulers.boundedElastic()
.flatMap(id -> Mono.fromCallable(()-> Pair.of(id, getInfoByID(id))))
.sequential()
.collect(Collector.toList()).block();
< /code>
private Info getInfoByID(String id){
var mono1= api1.getDetails();
var mono2= api2.getDetails();
Mono.zip(mono1, mono2)
.map(tuple2 -> {
…………
}).block();
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... -api-calls