Anuj Bhatnagar
Anuj Bhatnagar

Reputation: 1

couchbase timeout exception using Spring Data

At times I face connection timeout exception being thrown

Caused by: com.couchbase.client.deps.io.netty.channel.ConnectTimeoutException: connection timed out

I am using following environment configuration

@Override
protected CouchbaseEnvironment getEnvironment() {
    return DefaultCouchbaseEnvironment.builder()
            .connectTimeout(TimeUnit.SECONDS.toMillis(100))
            .computationPoolSize(6).autoreleaseAfter(9000).build();
}

my databuckets are auto wired in my services and I in one particular use case, I update a few documents across two data bucket. In case of connection being a bit iffy I get this exception and I am left with corrupt data of not all docs getting updated. Is there any connection retry mechanism which I can use if in case of connection failure?

Upvotes: 0

Views: 1811

Answers (1)

Simon Baslé
Simon Baslé

Reputation: 28301

As a temporary attempt to fix, can you try forcing the Couchbase Java SDK to bump to version 2.2.4? Add this to your pom.xml's <dependencies> section:

<dependency>
    <groupId>com.couchbase.client</groupId>
    <artifactId>java-client</artifactId>
    <version>2.2.4</version>
</dependency>

Upvotes: 0

Related Questions