Added documentation
This commit is contained in:
@@ -487,3 +487,16 @@ spring:
|
||||
inetutils:
|
||||
useOnlySiteLocalInterfaces: true
|
||||
----
|
||||
|
||||
[[http-clients]]
|
||||
=== HTTP Client Factories
|
||||
|
||||
Spring Cloud Commons provides beans for creating both Apache HTTP clients (`ApacheHttpClientFactory`)
|
||||
as well as OK HTTP clients (`OkHttpClientFactory`). The `OkHttpClientFactory` bean will only be created
|
||||
if the OK HTTP jar is on the classpath. In addition, Spring Cloud Commons provides beans for creating
|
||||
the connection managers used by both clients, `ApacheHttpClientConnectionManagerFactory` for the Apache
|
||||
HTTP client and `OkHttpClientConnectionPoolFactory` for the OK HTTP client. You can provide
|
||||
your own implementation of these beans if you would like to customize how the HTTP clients are created
|
||||
in downstream projects. You can also disable the creation of these beans by setting
|
||||
`spring.cloud.httpclientfactories.apache.enabled` or `spring.cloud.httpclientfactories.ok.enabled` to
|
||||
`false`.
|
||||
@@ -15,7 +15,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
public class HttpClientConfiguration {
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "spring.cloud.httpclient.apache.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.cloud.httpclientfactories.apache.enabled", matchIfMissing = true)
|
||||
static class ApacheHttpClientConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -32,7 +32,7 @@ public class HttpClientConfiguration {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ConditionalOnProperty(name = "spring.cloud.httpclient.ok.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.cloud.httpclientfactories.ok.enabled", matchIfMissing = true)
|
||||
@ConditionalOnClass(OkHttpClient.class)
|
||||
static class OkHttpClientConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user