Skip to content

Commit 37cf31f

Browse files
committed
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
1 parent 9a65968 commit 37cf31f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/couchbase/CouchbaseAutoConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.springframework.context.annotation.Bean;
3333
import org.springframework.context.annotation.Conditional;
3434
import org.springframework.context.annotation.Configuration;
35+
import org.springframework.context.annotation.DependsOn;
3536
import org.springframework.context.annotation.Primary;
3637

3738
/**
@@ -72,6 +73,7 @@ public Cluster couchbaseCluster() throws Exception {
7273

7374
@Bean
7475
@Primary
76+
@DependsOn("couchbaseClient")
7577
public ClusterInfo couchbaseClusterInfo() throws Exception {
7678
return couchbaseCluster()
7779
.clusterManager(this.properties.getBucket().getName(),

spring-boot-dependencies/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<commons-digester.version>2.1</commons-digester.version>
6666
<commons-pool.version>1.6</commons-pool.version>
6767
<commons-pool2.version>2.4.2</commons-pool2.version>
68-
<couchbase-client.version>2.3.6</couchbase-client.version>
68+
<couchbase-client.version>2.3.7</couchbase-client.version>
6969
<couchbase-cache-client.version>2.1.0</couchbase-cache-client.version>
7070
<crashub.version>1.3.2</crashub.version>
7171
<derby.version>10.13.1.1</derby.version>

0 commit comments

Comments
 (0)