importjava.util.LinkedHashMap;importjava.util.Map;importjava.util.Map.Entry;importjava.util.NoSuchElementException;importlombok.extern.slf4j.Slf4j;importorg.apache.commons.lang3.time.StopWatch;importreactor.core.publisher.Flux;importreactor.core.publisher.Mono;
@Slf4jpublic classTestFindMongo {private static final Maptemplates;private static final int sleep = 1000;static{
templates= new LinkedHashMap<>();
templates.put("aDB", "a");
templates.put("bDB", "b");
templates.put("cDB", "c");
}public MonofindMongo() {
StopWatch stopWatch=StopWatch.createStarted();returnFlux.fromIterable(templates.entrySet())
.filterWhen(
template->{
String key=template.getKey();
String value=template.getValue();try{
Thread.sleep(sleep);//mock DB query
<