ClientHttpRequestFactorySupplier and RestTemplateBuilder use to instantiate a ClientHttpRequestFactory.
However, i noticed that https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java is a ClientHttpRequestFactory but is also a DisposableBean that is supposed to close the underlying httpClient.
I may be wrong but this means that if we use ClientHttpRequestFactorySupplier or RestTemplateBuilder in conjunction with HttpComponentsClientHttpRequestFactory class, we may have a resource leak there.
Using Spring Boot 2.2.9 RELEASE, Spring Web 5.2.8 RELEASE
ClientHttpRequestFactorySupplierandRestTemplateBuilderuse to instantiate aClientHttpRequestFactory.However, i noticed that https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequestFactory.java is a
ClientHttpRequestFactorybut is also aDisposableBeanthat is supposed to close the underlying httpClient.I may be wrong but this means that if we use
ClientHttpRequestFactorySupplierorRestTemplateBuilderin conjunction withHttpComponentsClientHttpRequestFactoryclass, we may have a resource leak there.Using Spring Boot 2.2.9 RELEASE, Spring Web 5.2.8 RELEASE