Recently the SpringFramework introduced a RestClient
as a replacement for the RestTemplate
.
Currently I am stuck at streaming large files to a server, because I cannot control that data should only buffered for example with a 512 byte buffer in-memory.
By default, the file will be completely loaded into memory.
I am using application/octet-stream
as MIME type.
By using this HttpRequestFactory
for RestTemplate
, the file would not be buffered at all and worked pretty nicely, but does not for the RestClient
:
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setBufferRequestBody(false);
return requestFactory;
Maybe you can tell me, how to stream large files using the RestClient?