HttpComponentsClientHttpRequestFactory should not depend on CloseableHttpClient [SPR-12826] #17423
This dependency makes spring rest client support unusable for cases, where only bare implementation of HttpClient interface is needed - i.e. we have custom HttpClient - wrapper, for which is not useful to extend CloseableHttpClient (in the opposite it would complicate and mess all that thing).
I also believe it is bad practice to rely on abstract classes instead of interfaces.
Please consider to depend only on the HttpClient interface and implement the "closing logic" only for clients which also implements Closeable.
Well, I know I can provide custom ClientHttpRequestFactory for RestTemplate and it could be a workaround, but to do that I need to reimplement also HttpClientRequest and Response and whole the thing would be copy&paste from your code with only small change.
Referenced from: commits 370e3a5
Juergen Hoeller commented
Good point, I'm about to revise our implementation accordingly, considering the