Hello,
We have a java application that connects to multiple couch-base buckets. During the startup of spring we are getting the below error
Connect attempt 1 failed because of TimeoutException: Did not observe any item or terminal signal within 10000ms in \u0027source(MonoDefer)\u0027
We connect to these buckets similar to shown below
Private String consulDNS = “couchbase-xxx.service.consul”;
public @Bean Cluster getClusterInstance() {
ClusterEnvironment env = ClusterEnvironment.builder()
.ioConfig(IoConfig.enableDnsSrv(true))
.timeoutConfig(TimeoutConfig.kvTimeout(Duration.ofSeconds(5)))
.build();
if (cluster == null) {
cluster = Cluster.connect(consulDNS,
ClusterOptions.clusterOptions(username, password)
.environment(env));
}
return cluster;
}
public @Bean(“bucket1”)
Bucket connectBucket1() {
Bucket bucket = cluster.bucket(“bucket1”);
bucket.waitUntilReady(Duration.ofMinutes(1));
return bucket;
}
public @Bean(“bucket2”)
Bucket connectBucket2() {
Bucket bucket = cluster.bucket(“bucket2”);
bucket.waitUntilReady(Duration.ofMinutes(1));
return bucket;
}
Out of 10 times when we start the application we get 5-6 times this issue. Rest all times it starts fine without any issues. We use couchbase java client 3.0.10. Also note when we have only one bucket connection then we are not facing this issue. Can someone help us what could be the reason for this startup failure issue?
Thanks