Description
Jiri Mikulasek opened SPR-12826 and commented
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.
Affects: 4.1.5
Issue Links:
- Merge default request config with local customizations [SPR-12583] #17184 Merge default request config with local customizations
- Support CachingHttpAsyncClient from httpasyncclient-cache in HttpComponentsAsyncClientHttpRequestFactory [SPR-15664] #20223 Support CachingHttpAsyncClient from httpasyncclient-cache in HttpComponentsAsyncClientHttpRequestFactory
Referenced from: commits 370e3a5