From 37cf31f450228875c709e9f341c1270c63067faf Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 25 Jan 2017 14:51:09 +0000 Subject: [PATCH] Upgrade to Couchbase Java Client 2.3.7 In version 2.3.6 and earlier, an attempt to create a Bucket or a ClusterInfo would fail fast with a ConnectException in the cause of the Couchbase server was done. In 2.3.7 this remains true for a Bucket but is no longer the case for ClusterInfo. The latter now retries for 75 seconds by default and when it eventually fails a ConnectException is no longer part of the cause chain. This commit makes the auto-configured ClusterInfo depend on the auto-configured Bucket. This means that the Bucket is always created before the ClusterInfo, thereby ensuring that things fail gracefully with useful diagnostics when the server is unavailable. Closes gh-8092 --- .../autoconfigure/couchbase/CouchbaseAutoConfiguration.java | 2 ++ spring-boot-dependencies/pom.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java index aee7c60c34..ea2a9ba7f3 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java @@ -32,6 +32,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.DependsOn; import org.springframework.context.annotation.Primary; /** @@ -72,6 +73,7 @@ public class CouchbaseAutoConfiguration { @Bean @Primary + @DependsOn("couchbaseClient") public ClusterInfo couchbaseClusterInfo() throws Exception { return couchbaseCluster() .clusterManager(this.properties.getBucket().getName(), diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 5302bb2671..14e1caabbd 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -65,7 +65,7 @@ 2.1 1.6 2.4.2 - 2.3.6 + 2.3.7 2.1.0 1.3.2 10.13.1.1