I am trying to get all the responses from flux but sometimes I'm getting all the response and sometimes I'm not getting only few responses. Can anyone please help me on this. I have attached the picture for reference. I don't want to subscribe to that flux. I want those data's for manipulation.
urls i have key as name and url as value.
public LinkedHashMap<String String> getDummyHealthData (Map<String Strings urls) {
LinkedHashMap<String, String> urlMap=new LinkedHashMap<>();
Mono.when(Flux. fromStreamCurls.entryset().stream().log().flatmap(url->webclientBuilder.build().get().uri(url.getValue()).retrieve().bodyToMono (string.class). onSuccessorError((res,err)->{ urlMap.put(uri.getKey(),res); )}
).OnErrorResume (e->Mono.empty)).block(); System.out.println(urlMap)
return urlMap;
}