From 076acde72c414db0bdba52231d77e7673b8c42e3 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 11 Jun 2019 18:50:48 +0000 Subject: [PATCH 1/4] Update SNAPSHOT to 2.1.3.RELEASE --- README.adoc | 2 +- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.adoc b/README.adoc index d525e0f9..48ab1254 100644 --- a/README.adoc +++ b/README.adoc @@ -257,7 +257,7 @@ credentials and you already have those. The projects that require middleware generally include a `docker-compose.yml`, so consider using -https://compose.docker.io/[Docker Compose] to run the middeware servers +https://docs.docker.com/compose/[Docker Compose] to run the middeware servers in Docker containers. See the README in the https://github.com/spring-cloud-samples/scripts[scripts demo repository] for specific instructions about the common cases of mongo, diff --git a/docs/pom.xml b/docs/pom.xml index 2318a663..fed81a7a 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE .. diff --git a/pom.xml b/pom.xml index ff966659..322f0d10 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 2.1.4.BUILD-SNAPSHOT + 2.1.5.RELEASE @@ -27,7 +27,7 @@ config - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE true true diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 49e2a2b3..12bbf709 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 2a02e6a1..a5556228 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.4.BUILD-SNAPSHOT + 2.1.5.RELEASE spring-cloud-config-dependencies - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index ba420d08..23186e3f 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 2.1.1.BUILD-SNAPSHOT + 2.1.2.RELEASE diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 4a4666bc..685a9329 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index 6e4b025d..ac478e92 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index c7ff4588..a586b4cd 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE spring-cloud-starter-config - 2.1.3.BUILD-SNAPSHOT + 2.1.3.RELEASE spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 22d69e799b4ea969d2ab154dcdc4c40b52237e51 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 11 Jun 2019 18:52:29 +0000 Subject: [PATCH 2/4] Going back to snapshots --- README.adoc | 2 +- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.adoc b/README.adoc index 48ab1254..d525e0f9 100644 --- a/README.adoc +++ b/README.adoc @@ -257,7 +257,7 @@ credentials and you already have those. The projects that require middleware generally include a `docker-compose.yml`, so consider using -https://docs.docker.com/compose/[Docker Compose] to run the middeware servers +https://compose.docker.io/[Docker Compose] to run the middeware servers in Docker containers. See the README in the https://github.com/spring-cloud-samples/scripts[scripts demo repository] for specific instructions about the common cases of mongo, diff --git a/docs/pom.xml b/docs/pom.xml index fed81a7a..2318a663 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 322f0d10..ff966659 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 2.1.5.RELEASE + 2.1.4.BUILD-SNAPSHOT @@ -27,7 +27,7 @@ config - 2.1.2.RELEASE + 2.1.2.BUILD-SNAPSHOT true true diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 12bbf709..49e2a2b3 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index a5556228..2a02e6a1 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.5.RELEASE + 2.1.4.BUILD-SNAPSHOT spring-cloud-config-dependencies - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index 23186e3f..ba420d08 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 2.1.2.RELEASE + 2.1.1.BUILD-SNAPSHOT diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 685a9329..4a4666bc 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index ac478e92..6e4b025d 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index a586b4cd..c7ff4588 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT spring-cloud-starter-config - 2.1.3.RELEASE + 2.1.3.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 33d5294b5a32153c62cc97ff42e834acabf9239b Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 11 Jun 2019 18:52:29 +0000 Subject: [PATCH 3/4] Bumping versions to 2.1.4.BUILD-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 2 +- spring-cloud-config-monitor/pom.xml | 2 +- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 2318a663..7ad3a377 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index ff966659..17749677 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT pom Spring Cloud Config Spring Cloud Config diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 49e2a2b3..a14c6fb8 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 2a02e6a1..f86cf856 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -10,7 +10,7 @@ spring-cloud-config-dependencies - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index ba420d08..4a77b3d4 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT .. spring-cloud-config-monitor diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 4a4666bc..4b47428b 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index 6e4b025d..51663ebf 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index c7ff4588..aedadef5 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT spring-cloud-starter-config - 2.1.3.BUILD-SNAPSHOT + 2.1.4.BUILD-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 0abf2abdc7762ec5f64b92c42778af4b7b64c80a Mon Sep 17 00:00:00 2001 From: Chase Diem Date: Thu, 13 Jun 2019 06:39:28 -0400 Subject: [PATCH 4/4] Add connect time out setting for config client (#1403) (#1406) --- docs/src/main/asciidoc/spring-cloud-config.adoc | 7 +++++-- .../config/client/ConfigClientProperties.java | 14 ++++++++++++++ .../client/ConfigServicePropertySourceLocator.java | 4 ++++ .../ConfigServicePropertySourceLocatorTests.java | 10 ++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-config.adoc b/docs/src/main/asciidoc/spring-cloud-config.adoc index ac57725e..6f01e107 100644 --- a/docs/src/main/asciidoc/spring-cloud-config.adoc +++ b/docs/src/main/asciidoc/spring-cloud-config.adoc @@ -1377,9 +1377,12 @@ To ensure high availability when you have multiple instances of Config Server de If you use HTTP basic security on your Config Server, it is currently possible to support per-Config Server auth credentials only if you embed the credentials in each URL you specify under the `spring.cloud.config.uri` property. If you use any other kind of security mechanism, you cannot (currently) support per-Config Server authentication and authorization. -=== Configuring Read Timeouts +=== Configuring Timeouts -If you want to configure read timeout, this can be done by using the property `spring.cloud.config.request-read-timeout`. +If you want to configure timeout thresholds: + +* Read timeouts can be configured by using the property `spring.cloud.config.request-read-timeout`. +* Connection timeouts can be configured by using the property `spring.cloud.config.request-connect-timeout`. === Security diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java index 32da6ebb..11b215b6 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigClientProperties.java @@ -114,6 +114,11 @@ public class ConfigClientProperties { */ private int requestReadTimeout = (60 * 1000 * 3) + 5000; + /** + * timeout on waiting to connect to the Config Server. + */ + private int requestConnectTimeout = 1000 * 10; + /** * Flag to indicate whether to send state. Default true. */ @@ -227,6 +232,14 @@ public class ConfigClientProperties { this.requestReadTimeout = requestReadTimeout; } + public int getRequestConnectTimeout() { + return this.requestConnectTimeout; + } + + public void setRequestConnectTimeout(int requestConnectTimeout) { + this.requestConnectTimeout = requestConnectTimeout; + } + public boolean isSendState() { return this.sendState; } @@ -333,6 +346,7 @@ public class ConfigClientProperties { + ", username=" + this.username + ", password=" + this.password + ", uri=" + Arrays.toString(this.uri) + ", discovery=" + this.discovery + ", failFast=" + this.failFast + ", token=" + this.token + + ", requestConnectTimeout=" + this.requestConnectTimeout + ", requestReadTimeout=" + this.requestReadTimeout + ", sendState=" + this.sendState + ", headers=" + this.headers + "]"; } diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocator.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocator.java index fd8bf2e9..be4cb5c8 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocator.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocator.java @@ -257,7 +257,11 @@ public class ConfigServicePropertySourceLocator implements PropertySourceLocator if (client.getRequestReadTimeout() < 0) { throw new IllegalStateException("Invalid Value for Read Timeout set."); } + if (client.getRequestConnectTimeout() < 0) { + throw new IllegalStateException("Invalid Value for Connect Timeout set."); + } requestFactory.setReadTimeout(client.getRequestReadTimeout()); + requestFactory.setConnectTimeout(client.getRequestConnectTimeout()); RestTemplate template = new RestTemplate(requestFactory); Map headers = new HashMap<>(client.getHeaders()); if (headers.containsKey(AUTHORIZATION)) { diff --git a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java index 7857eb00..7b34385e 100644 --- a/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java +++ b/spring-cloud-config-client/src/test/java/org/springframework/cloud/config/client/ConfigServicePropertySourceLocatorTests.java @@ -261,6 +261,16 @@ public class ConfigServicePropertySourceLocatorTests { ReflectionTestUtils.invokeMethod(this.locator, "getSecureRestTemplate", defaults); } + @Test + public void shouldThrowExceptionWhenNegativeConnectTimeoutSet() { + ConfigClientProperties defaults = new ConfigClientProperties(this.environment); + defaults.setRequestConnectTimeout(-1); + this.locator = new ConfigServicePropertySourceLocator(defaults); + this.expected.expect(IllegalStateException.class); + this.expected.expectMessage("Invalid Value for Connect Timeout set."); + ReflectionTestUtils.invokeMethod(this.locator, "getSecureRestTemplate", defaults); + } + @Test public void checkInterceptorHasNoAuthorizationHeaderPresent() { ConfigClientProperties defaults = new ConfigClientProperties(this.environment);