You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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.
Good point, I'm about to revise our implementation accordingly, considering the Closeable / CloseableHttpClient type as an option only and therefore being able to work with plain HttpClient implementations as well. This will be available in tomorrow's 4.2 snapshot.
Activity
spring-projects-issues commentedon Mar 17, 2015
Juergen Hoeller commented
Good point, I'm about to revise our implementation accordingly, considering the
Closeable/CloseableHttpClienttype as an option only and therefore being able to work with plainHttpClientimplementations as well. This will be available in tomorrow's 4.2 snapshot.Juergen
spring-projects-issues commentedon Mar 17, 2015
Jiri Mikulasek commented
Thanks for really quick response - I just tested the nightly SNAPSHOT with our HttpClient wrapper and it worked smoothly.
Jiri