You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add example in the docs on how to use the HttpClientConnectionManagerBuilderCustomizer, as it already exists for httpClient5FeignConfiguration.HttpClientBuilderCustomizer a few lines above
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-openfeign.adoc
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,14 +144,13 @@ When it comes to the Apache HttpClient 5-backed Feign clients, it's enough to en
144
144
You can customize the HTTP client used by providing a bean of either `org.apache.hc.client5.http.impl.classic.CloseableHttpClient` when using Apache HC5.
145
145
146
146
You can further customise http clients by setting values in the `spring.cloud.openfeign.httpclient.xxx` properties. The ones prefixed just with `httpclient` will work for all the clients, the ones prefixed with `httpclient.hc5` to Apache HttpClient 5, and the ones prefixed with `httpclient.http2` to Http2Client. You can find a full list of properties you can customise in the appendix.
147
-
If you can not configure Apache HttpClient 5 by using properties, there is an `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` interface for programmatic configuration. Similarly, to configure the `HttpClientConnectionManager`, you can use `HttpClient5FeignConfiguration.HttpClientConnectionManagerBuilderCustomizer`.
147
+
If you can not configure Apache HttpClient 5 by using properties, there is an `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` interface for programmatic configuration. Similarly, to configure the `HttpClientConnectionManager`, you can use `HttpClient5FeignConfiguration.HttpClientConnectionManagerBuilderCustomizer`. Both usages are shown in the example below.
148
148
149
149
TIP: Apache HTTP Components `5.4` have changed defaults in the HttpClient relating to HTTP/1.1 TLS upgrades. Most proxy servers handle upgrades without issue, however, you may encounter issues with Envoy or Istio. If you need to restore previous behaviour, you can use `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` to do it, as shown in the example below.
150
150
151
151
[source,java,indent=0]
152
152
----
153
-
@Configuration
154
-
public class FooConfiguration {
153
+
public class HttpClientConfiguration {
155
154
156
155
@Bean
157
156
public HttpClient5FeignConfiguration.HttpClientBuilderCustomizer httpClientBuilder() {
@@ -164,6 +163,24 @@ public class FooConfiguration {
164
163
}
165
164
----
166
165
166
+
TIP: Apache HTTP Components `5.5.1` have changed defaults in the HttpClient relating to TLS handshake timeouts. An unset TLS handshake timeout is now implicitly bound by the `connectTimeout` while it was unbounded previously. To restore previous defaults, you can use `HttpClient5FeignConfiguration.HttpClientBuilderCustomizer` to do it, as shown in the example below.
167
+
168
+
[source,java,indent=0]
169
+
----
170
+
public class HttpClientConnectionManagerConfiguration {
171
+
172
+
@Bean
173
+
public HttpClient5FeignConfiguration.HttpClientConnectionManagerBuilderCustomizer httpClientConnectionManagerBuilder() {
TIP: Starting with Spring Cloud OpenFeign 4, the Feign Apache HttpClient 4 is no longer supported. We suggest using Apache HttpClient 5 instead.
168
185
169
186
Spring Cloud OpenFeign _does not_ provide the following beans by default for feign, but still looks up beans of these types from the application context to create the Feign client:
0 commit comments