-
Task
-
Resolution: Done
-
Medium
-
None
-
None
Spring Boot's RestTemplateBuilder will choose a HTTP client to use at runtime depending on what is available on the class path. This can lead to different behaviour (see CPS-1968), for example the Apache client uses connection pooling (with a default limit of 5 connections per host) versus Jetty client which does not use pooling.
This task is to use Apache client in NCMP and allow it to be configured through Spring application.yml
public static ClientHttpRequestFactory get(ClientHttpRequestFactorySettings settings) { Assert.notNull(settings, "Settings must not be null"); if (APACHE_HTTP_CLIENT_PRESENT) { return HttpComponents.get(settings); } if (JETTY_CLIENT_PRESENT) { return Jetty.get(settings); } if (OKHTTP_CLIENT_PRESENT) { return OkHttp.get(settings); } return Simple.get(settings); }