I have a Flux that has a doOnNext(this::dumpJson) but for some odd reason it stops on the first one if I do this
private void dumpJson(Object it) {
try {
objectMapper.writerWithDefaultPrettyPrinter().writeValue(System.out, it);
System.out.flush();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
But if I convert to a String then write it out afterwards it works.
private void dumpJson(Object it) {
try {
final var s = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(it);
System.out.println(s);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}