Skip to content

Read large data using InputStreamResource at ResourceHttpMessageConverter [SPR-13443] #18023

Closed
@spring-projects-issues

Description

@spring-projects-issues

Kazuki Shimizu opened SPR-13443 and commented

Currently,ResourceMessageConverter is reading as ByteArrayResource from the HTTP body. If large data has been set at http body, there is possibility that occur the OutOfMemoryError.

I want to be able to read as InputStreamResource as follows:

RestTemplate restTemplate = new RestTemplate();
Resource resource = restTemplate.getForObject("http://localhost:8080/myApp/foo.zip", InputStreamResource.class);

How do think ?
I submit a PR at the later.


Affects: 4.2.1

Issue Links:

Referenced from: pull request #871, and commits 1feb757

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions