'collecting Monos on each subscribe() from db operation
I want to do db update to every record. I am using Mono for every record update, this work fine with .block() but giving unpredicatable result when using .subscribe(). Since .block() is not right approach for large number of records, I thought to combine all mono db calls and return a combined result as success for failure but since .subscribe() returns Disposabe object - I am not able to collect all Monos in List or not able to use Mono.zip() or any other way of collecting monos
for(Record record : records){
List<Mono<Void>> monos = dataStore
.set(key, value) //this is for db insert that returns Mono<Void> for every record
.subscribe() // error as return type is not Mono<Void>
}
Mono.zip(monos)
.subscribe() //error as return type is not Mono<Void>```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
