Merge remote-tracking branch 'origin/3.1.x'
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|feign.httpclient.hc5.socket-timeout-unit | | Default value for socket timeout unit.
|
||||
|feign.httpclient.max-connections | `200` |
|
||||
|feign.httpclient.max-connections-per-route | `50` |
|
||||
|feign.httpclient.ok-http-client-properties.read-timeout | `60s` | {@link OkHttpClient} read timeout; defaults to 60 seconds.
|
||||
|feign.httpclient.ok-http.read-timeout | `60s` | {@link OkHttpClient} read timeout; defaults to 60 seconds.
|
||||
|feign.httpclient.time-to-live | `900` |
|
||||
|feign.httpclient.time-to-live-unit | |
|
||||
|feign.metrics.enabled | `true` | Enables metrics capability for Feign.
|
||||
|
||||
@@ -286,7 +286,7 @@ public class FeignAutoConfiguration {
|
||||
boolean followRedirects = httpClientProperties.isFollowRedirects();
|
||||
int connectTimeout = httpClientProperties.getConnectionTimeout();
|
||||
boolean disableSslValidation = httpClientProperties.isDisableSslValidation();
|
||||
Duration readTimeout = httpClientProperties.getOkHttpClientProperties().getReadTimeout();
|
||||
Duration readTimeout = httpClientProperties.getOkHttp().getReadTimeout();
|
||||
this.okHttpClient = httpClientFactory.createBuilder(disableSslValidation)
|
||||
.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS).followRedirects(followRedirects)
|
||||
.readTimeout(readTimeout).connectionPool(connectionPool).build();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class OkHttpFeignConfiguration {
|
||||
FeignHttpClientProperties httpClientProperties) {
|
||||
boolean followRedirects = httpClientProperties.isFollowRedirects();
|
||||
int connectTimeout = httpClientProperties.getConnectionTimeout();
|
||||
Duration reaTimeout = httpClientProperties.getOkHttpClientProperties().getReadTimeout();
|
||||
Duration reaTimeout = httpClientProperties.getOkHttp().getReadTimeout();
|
||||
this.okHttpClient = httpClientFactory.createBuilder(httpClientProperties.isDisableSslValidation())
|
||||
.connectTimeout(connectTimeout, TimeUnit.MILLISECONDS).followRedirects(followRedirects)
|
||||
.readTimeout(reaTimeout).connectionPool(connectionPool).build();
|
||||
|
||||
@@ -95,7 +95,7 @@ public class FeignHttpClientProperties {
|
||||
/**
|
||||
* Additional {@link OkHttpClient}-specific properties.
|
||||
*/
|
||||
private OkHttpClientProperties okHttpClientProperties = new OkHttpClientProperties();
|
||||
private OkHttp okHttp = new OkHttp();
|
||||
|
||||
public int getConnectionTimerRepeat() {
|
||||
return connectionTimerRepeat;
|
||||
@@ -169,12 +169,12 @@ public class FeignHttpClientProperties {
|
||||
this.hc5 = hc5;
|
||||
}
|
||||
|
||||
public OkHttpClientProperties getOkHttpClientProperties() {
|
||||
return okHttpClientProperties;
|
||||
public OkHttp getOkHttp() {
|
||||
return okHttp;
|
||||
}
|
||||
|
||||
public void setOkHttpClientProperties(OkHttpClientProperties okHttpClientProperties) {
|
||||
this.okHttpClientProperties = okHttpClientProperties;
|
||||
public void setOkHttp(OkHttp okHttp) {
|
||||
this.okHttp = okHttp;
|
||||
}
|
||||
|
||||
public static class Hc5Properties {
|
||||
@@ -292,7 +292,7 @@ public class FeignHttpClientProperties {
|
||||
/**
|
||||
* {@link OkHttpClient}-specific properties.
|
||||
*/
|
||||
public static class OkHttpClientProperties {
|
||||
public static class OkHttp {
|
||||
|
||||
/**
|
||||
* {@link OkHttpClient} read timeout; defaults to 60 seconds.
|
||||
|
||||
@@ -45,7 +45,7 @@ class FeignOkHttpConfigurationTests {
|
||||
void setUp() {
|
||||
this.context = new SpringApplicationBuilder()
|
||||
.properties("debug=true", "feign.httpclient.disableSslValidation=true", "feign.okhttp.enabled=true",
|
||||
"feign.httpclient.enabled=false", "feign.httpclient.okhttp-client-properties.read-timeout=9s")
|
||||
"feign.httpclient.enabled=false", "feign.httpclient.okhttp.read-timeout=9s")
|
||||
.web(WebApplicationType.NONE).sources(HttpClientConfiguration.class, FeignAutoConfiguration.class)
|
||||
.run();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ class FeignLoadBalancerAutoConfigurationTests {
|
||||
void shouldInstantiateOkHttpFeignClientWhenEnabled() {
|
||||
ConfigurableApplicationContext context = initContext("feign.httpclient.enabled=false",
|
||||
"feign.okhttp.enabled=true", "spring.cloud.loadbalancer.retry.enabled=false",
|
||||
"feign.httpclient.okhttp-client-properties.read-timeout=9s");
|
||||
"feign.httpclient.okhttp.read-timeout=9s");
|
||||
assertThatOneBeanPresent(context, BlockingLoadBalancerClient.class);
|
||||
Map<String, FeignBlockingLoadBalancerClient> beans = context
|
||||
.getBeansOfType(FeignBlockingLoadBalancerClient.class);
|
||||
|
||||
Reference in New Issue
Block a user