In below code I am filtering elements ina flux based on some logic and then further filtering based on the result of webservice call. Now the webservice returns a Mono so I can use it in the filter method. calling block() doesn't work. Can someone how to go about this. Thanks in advance. The code is not fully compilable as I removed company specific code.
protected Flux<> getFilteredResults(Flux<> resultsToFilter, boolean someBoolean) {
return resultsToFilter.filter(cr -> {
//Filtering logic
})
.filter( a-> {
Mono<Boolean> serviceCallResult = makeServiceCall(a);
return serviceCallResult.block(); //HOW TO DO THIS CORRECTLY
});
}