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.
See spring-projects/spring-boot#31075 (comment) for background.
The goal of this issue is to review contracts around
ClientHttpRequestFactoryresource management.These days,
RestTemplateinstances aren't contributed as beans to the application context. This trend also applies toWebClient. 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
ClientHttpRequestFactoryshould extendCloseable, 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 makeHttpAccessorextendCloseable, since it's itself instantiating arequestFactory.