Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit resource cleanup in RestTemplate and ClientHttpRequestFactory #29010

Closed
bclozel opened this issue Aug 24, 2022 · 0 comments
Closed

Revisit resource cleanup in RestTemplate and ClientHttpRequestFactory #29010

bclozel opened this issue Aug 24, 2022 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Aug 24, 2022

See spring-projects/spring-boot#31075 (comment) for background.

The goal of this issue is to review contracts around ClientHttpRequestFactory resource management.

These days, RestTemplate instances aren't contributed as beans to the application context. This trend also applies to WebClient. As pointed out by the comment above, current usage patterns are not in line with how resources are supposed to be cleaned.

As part of this issue, we should consider whether ClientHttpRequestFactory should extend Closeable, and align all implementations with that change. As part of that, we should then review all places where request factories are instantiated in Framework; we might need to also make HttpAccessor extend Closeable, since it's itself instantiating a requestFactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant