feign icon indicating copy to clipboard operation
feign copied to clipboard

How does Feign's ApacheHttpClient close the underlying CloseableHttpClient?

Open manouti opened this issue 3 years ago • 0 comments

I'm looking at ApacheHttpClient, and was wondering about something: it internally creates an HttpClient to perform the http requests, but doesn't seem to be closing it.

public ApacheHttpClient() {
   this(HttpClientBuilder.create().build());
}

More specifically if I look at the builder method, it returns an instance of a CloseableHttpClient which according to its documentation, it should be closed:

When an HttpClient instance is no longer needed and is about to go out of scope it is important to shut down its connection manager to ensure that all connections kept alive by the manager get closed and system resources allocated by those connections are released.

CloseableHttpClient httpClient = <...>
httpClient.close();

I'm wondering if anyone has had issues with it, or maybe I'm missing something around Feign's usage of the client.

manouti avatar Mar 30 '22 07:03 manouti