consul-api icon indicating copy to clipboard operation
consul-api copied to clipboard

DefaultHttpTransport should close its inner HttpClient

Open laymain opened this issue 6 years ago • 1 comments

The DefaultHttpTransport creates a HttpClient which is closeable

https://github.com/Ecwid/consul-api/blob/d68de32084bead34fbde29b0cf7494f2b4c206aa/src/main/java/com/ecwid/consul/transport/DefaultHttpTransport.java#L28-L33

It should be closed.

laymain avatar Sep 12 '18 10:09 laymain

Hi,

I agree with you that, in theory, we should allow users to close internal HttpClient (just as any other Closeable resource). However, in most applications ConsulClient (and DefaultHttpTransport) is working all time application exists.

Could you please explain the practical reasons to close inner HttpClient?

vgv avatar Nov 04 '18 20:11 vgv