- All Implemented Interfaces:
- org.springframework.beans.factory.DisposableBean
@Component(value="synchrony-http-client-factory")
public class SynchronyHttpClientFactory
extends Object
implements org.springframework.beans.factory.DisposableBean
Factory for Synchrony HTTP client.
When using the Apache HttpClient, to make sure resources are freed optimally, you should either:
- Use a ResponseHandler, which will already do the right thing, OR
- Do the following:
1. Completely consume the response entity (see EntityUtils.consume), unless it's not possible for performance reasons.
That frees resources in a way that allows reusing the underlying connection.
2. Always close the response anyway.
If it was already closed correctly by the entity consumption, it's ok.
If it wasn't, all resources are freed including the underlying connection (which in this case won't be reusable)