Hello,
I have an issue setting up keepAliveInterval and maxRequestLifetime parameters after couchbase client upgrade to v3.2.6.
I am trying to override
protected void configureEnvironment(ClusterEnvironment.Builder builder) {
TimeoutConfig.Builder timeoutConfig = TimeoutConfig
.connectTimeout(Duration.ofMillis(xx))
.queryTimeout(Duration.ofMillis(yy));
builder.timeoutConfig(timeoutConfig); }
but cannot find necessary object/property to set up keepAliveInterval and maxRequestLifetime.
Could you please help?
Hi Natalia,
I suspect the keepAliveInterval
and maxRequestLifetime
settings from SDK 2 do not have exact counterparts in SDK 3. The reference documentation for Java SDK 3 client settings lists some close matches, though.
For keepAliveInterval
, I’m not aware of an exact equivalent in SDK 3 – it just doesn’t do keepalives in the same was as SDK 2. The closest option is tcpKeepAliveTime
in the IO config section.
Instead of SDK 2’s single maxRequestLifetime
, SDK 3 allows configuring timeouts independently for each service. You’ve already configured the queryTimeout
. It’s also possible to specify the kvTimeout
, analyticsTimeout
, searchTimeout
(for Full-Text Search), etc.
In code, all of this might look like:
protected void configureEnvironment(ClusterEnvironment.Builder builder) {
builder.ioConfig()
.tcpKeepAliveTime(Duration.ofMillis(aa));
builder.timeoutConfig()
.connectTimeout(Duration.ofMillis(xx))
.queryTimeout(Duration.ofMillis(yy))
.kvTimeout(Duration.ofMillis(zz));
}
Thanks,
David
Thank you David, for your extensive response