spring-framework/spring-web
Brian Clozel 19d991a67b Revisit resource cleanup in ClientHttpRequestFactory
Prior to this commit, resource management around
`ClientHttpRequestFactory` and `RestTemplate` was unclear. Some
factories implementation were implementing a `DisposableBean` and other
contracts were not managing request factory resources.

In the meantime, neither `ClientHttpRequestFactory` nor `RestTemplate`
are typically meant to be contributed as beans to the application
context. Most often, they're instantiated within beans and their
lifecycle should be managed by those.

This commit makes all `ClientHttpRequestFactory` `Closeable` and ensures
that all existing implementations have a similar behavior between
`dispose()` and `close()`. Since `RestTemplate` (actually
`HttpAccessor`) can instantiate factories on its own, they also now
extend `Closeable` to properly close those resources, if not externally
managed.

Closes gh-29010
2022-09-13 15:53:01 +02:00
..
src Revisit resource cleanup in ClientHttpRequestFactory 2022-09-13 15:53:01 +02:00
spring-web.gradle Instrument RestTemplate for Observability 2022-09-12 11:37:41 +02:00