Our project was in spring boot version 2.2.1 (spring-data-couchbase version 2.2.1 and couchbase SDK 3.2.1) , we have to upgrade this project to Spring boot 2.4.1 (spring-data-couchbase version 2.4.1 and couchbase SDK 4.2.1) , a lot of things have changed from couchbase SDK 3.x to 4.x , which are captured in the document here ,
But still I could not find some of things or configuration and how to do them in the newer version ,
It seems in the newer version they have removed QueryServiceConfig and DefaultCouchbaseEnvironment classes , Does anyone know how to define these configs in the newer version ? I mean the autoreleaseAfter , queryservice minEndpoints and maxEndpoints , I tried creating them via application.yaml but doesnt work , Any help is greatly appreciated.
/**
* Can be overridden to customize the configuration of the environment before bootstrap.
*
* @param builder the builder that can be customized.
*/
protected void configureEnvironment(final ClusterEnvironment.Builder builder) {
}
Thanks a lot for your reply , I did see and try that but , the ClusterEnvironment class has the below 3 options to set
private final JsonSerializer jsonSerializer;
private final Transcoder transcoder;
private final Optional<CryptoManager> cryptoManager;
and it extends CoreEnvironment that gives me the below options to set ,
private final UserAgent userAgent;
private final Supplier<EventBus> eventBus;
private final Timer timer;
private final IoEnvironment ioEnvironment;
private final IoConfig ioConfig;
private final CompressionConfig compressionConfig;
private final SecurityConfig securityConfig;
private final TimeoutConfig timeoutConfig;
private final OrphanReporterConfig orphanReporterConfig;
private final ThresholdRequestTracerConfig thresholdRequestTracerConfig;
private final Supplier<RequestTracer> requestTracer;
private final LoggerConfig loggerConfig;
private final RetryStrategy retryStrategy;
private final Supplier<Scheduler> scheduler;
private final OrphanReporter orphanReporter;
private final long maxNumRequestsInRetry;
I could not find any QuerryConfig to be set here nor the autoreleaseAfter option , Could you please guide me as to how do I set these options using the ClusterEnvironment or the CoreEnvironment ?
Thanks @mreiche , but the crux of the problem is that the class DefaultCouchbaseEnvironment is no more in version 2.4.1 , without this class how do I configure the QueryServiceConfig ?
In com.couchbase.client.core.node.Node.createService() the QuerySerivceConfig uses values from env.ioConfig() :
return new QueryService(QueryServiceConfig
.maxEndpoints(env.ioConfig().maxHttpConnections())
.idleTime(env.ioConfig().idleHttpConnectionTimeout())
.build(),
ctx, address, port
);
And those can be set by overriding configureEnvironment() of your Config class (that extends AbstractCouchbaseConfiguration) like:
Thanks a lot @mreiche , that solves it but have one question if we do not require the QueryServiceConfig , why do we have it for ? or is it still needed at some place ?