I'm trying to download a large file via Spring Boot's WebClient (per advice from https://stackoverflow.com/a/60725206):
Flux<DataBuffer> dataBufferFlux = webClientEmbed.get()
.uri(someUri)
// ...
.retrieve()
.bodyToFlux(DataBuffer.class);
DataBufferUtils
.write(dataBufferFlux, somePath, CREATE)
.block();
The problem is, I have no idea how to track the progress and speed of the download or even detect when the write breaks (other than using doOnError which doesn't seem to be detecting every error...). I've scoured the docs and can't find any info on how to do that at all. I suspect I may be too much a of a WebFlux newb but I'm at my wit's end here.
What is the correct way to track the progress of a WebClient download when using the DataBuffer class?