Description
Alexander Wilhelmer opened SPR-15949 and commented
I noticed problems when u using this construct:
public Flux<DataBuffer> getFileContent(String url) {
Mono<ClientResponse> exchange = webClientService.getWebClient().get().uri(url).accept(MediaType.APPLICATION_OCTET_STREAM).exchange();
return exchange.flatMapMany(clientResponse -> {
return clientResponse.bodyToFlux(DataBuffer.class);
});
}
You have to use a HTTP source with transcoding: chunked header without a content-length header. The problem of incomplete chunks only appears when you deploy the spring application on a windows system. I can't reproduce it on linux e.g. ubuntu. I'm using Windows Server 2008 R2 and Windows Server 2003, both with java 1.8 update 144. Requests against localhost works too, you have to stream over network!
Example: I deployed the app on windows. Just call http://217.79.182.40:8091/download/stream/102400 a few times. You will get a Network Error sometimes (1-3 errors on ten attempts). I'll keep that server online for max 7 days.
Source see at reference URL.
Affects: 5.0 RC3
Reference URL: https://github.com/awilhelmer/streambug
Attachments:
- errors.png (4.25 kB)
- screenshot-1.png (3.53 kB)
Issue Links:
- WebClient: DELETE request should not send transfer-encoding: chunked header [SPR-15947] #20500 WebClient: DELETE request should not send transfer-encoding: chunked header
- Multipart File upload: Sometimes receiving empty files! [SPR-15955] #20507 Multipart File upload: Sometimes receiving empty files!
Referenced from: commits ec2218c