How to perform Spring Boot version upgrade in an application which uses CouchBase functionality

Viewed 39

We are currently using Spring Boot 2.2.13 version with java 1.8-based dependencies. We have been requested to upgrade to Spring Boot version 2.7.3. with Java 11 support. we are facing a lot of chanllenges in relation to the Spring Boot Couchbase dependencies.

The build.gradle dependencies currently used are listed below

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:Hoxton.RELEASE"
    }
}

dependencies {


    implementation fileTree(dir: 'libs', include: '*.jar')

    implementation ("io.grpc:grpc-netty:${grpcVersion}")
    implementation "org.modelmapper:modelmapper:${modelMapperVersion}"

    implementation 'org.springframework.boot:spring-boot-devtools'
    //compile group: 'org.aspectj', name: 'aspectjweaver'// commented by bhawani to check the license issue on nexus
    implementation "net.logstash.logback:logstash-logback-encoder:5.1"
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    implementation 'org.projectreactor:reactor-spring:1.0.1.RELEASE'
    implementation group: 'com.oracle.oci.sdk', name: 'oci-java-sdk-objectstorage', version: '1.15.4'
    implementation group: 'com.oracle.oci.sdk', name: 'oci-java-sdk-identity', version: '1.15.4'
    implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
    implementation group: 'org.springframework.integration', name: 'spring-integration-core', version: '5.3.1.RELEASE'
    implementation group: 'org.springframework.integration', name: 'spring-integration-file', version: '5.3.1.RELEASE'
    implementation group: 'org.springframework.integration', name: 'spring-integration-sftp', version: '5.3.1.RELEASE'
    implementation group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.13'
    implementation 'io.micrometer:micrometer-registry-prometheus'
    implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
    implementation group: 'com.sun.xml.messaging.saaj', name: 'saaj-impl', version: '1.5.1'
    implementation group: 'io.github.lognet', name: 'grpc-spring-boot-starter', version: '4.0.0'
    implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.17.1'

    implementation 'com.amazonaws:aws-java-sdk-s3:1.11.163'
    implementation ("org.springframework.retry:spring-retry:1.2.5.RELEASE")

    implementation group: 'org.aspectj', name: 'aspectjweaver', version: '1.9.6'
    implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
    implementation "io.grpc:grpc-protobuf:${grpcVersion}"
    implementation "io.grpc:grpc-stub:${grpcVersion}"
    implementation "io.grpc:grpc-services:${grpcVersion}"
    implementation "ch.qos.logback.contrib:logback-json-classic:${logbackJsonVersion}"
    implementation "ch.qos.logback.contrib:logback-jackson:${logbackJsonVersion}"
    implementation 'jakarta.xml.ws:jakarta.xml.ws-api'

    implementation 'org.jetbrains:annotations:15.0'
    implementation "org.springframework.boot:spring-boot-starter-data-couchbase"
    implementation 'org.apache.kafka:kafka-streams'
    implementation 'org.springframework.kafka:spring-kafka'
    implementation 'org.springframework.integration:spring-integration-core'
    implementation "io.github.lognet:grpc-spring-boot-starter"
    implementation 'org.springframework.boot:spring-boot-starter-cache'
    implementation "org.springframework.boot:spring-boot-starter-security"
    implementation group: 'commons-codec', name: 'commons-codec', version: '1.15'

    //sleuth implementation for tracing

    implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-sleuth'
    implementation group: 'io.zipkin.brave', name: 'brave-instrumentation-grpc', version: '5.9.0'
    implementation group: 'io.zipkin.brave', name: 'brave-instrumentation-messaging', version: '5.9.0'


    compileOnly 'org.projectlombok:lombok:1.18.8'
    annotationProcessor 'org.projectlombok:lombok:1.18.8'

    testImplementation group: 'com.openpojo', name: 'openpojo', version: '0.8.10'
    testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
    testImplementation 'org.powermock:powermock-core:1.7.4'
    testImplementation 'org.powermock:powermock-module-testng:1.7.4'
    testImplementation 'org.powermock:powermock-api-mockito2:1.7.4'
    testImplementation 'org.springframework.kafka:spring-kafka-test'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.integration:spring-integration-test'
    testCompileOnly ("org.projectlombok:lombok:1.18.8")
    testAnnotationProcessor ("org.projectlombok:lombok:1.18.8")
}

configurations {
    runtime.exclude group: "org.slf4j", module: "slf4j-log4j12"
    compile.exclude group: "org.slf4j", module: "slf4j-log4j12"
}

configurations.all {
   exclude group:"org.apache.commons", module: "commons-compress"
}

When attempting to migrate com.couchbase.client package functionality used in the current system to relevant Spring-boot-starter-data-couchbase new dependencies is proving to be "rough terrain" as relevant information on some imports is not found in the documentation I came across.

The imports that we are currently having issues with are listed below.


***com.couchbase.client.java.Bucket;
com.couchbase.client.java.Cluster;
com.couchbase.client.java.CouchbaseCluster;
com.couchbase.client.java.cluster.ClusterInfo;
com.couchbase.client.java.env.CouchbaseEnvironment;
com.couchbase.client.java.env.DefaultCouchbaseEnvironment;
com.couchbase.client.java.error.DocumentDoesNotExistException;
com.couchbase.client.java.document.json.JsonObject;
com.couchbase.client.java.query.N1qlQuery;
com.couchbase.client.java.query.N1qlQueryResult;
com.couchbase.client.java.query.N1qlQueryRow;
com.couchbase.client.java.repository.annotation.Field;
com.couchbase.client.java.document.json.JsonArray;
com.couchbase.client.core.CouchbaseException;
com.couchbase.client.java.document.JsonDocument;
com.couchbase.client.deps.com.fasterxml.jackson.core.JsonParseException;
com.couchbase.client.deps.com.fasterxml.jackson.core.JsonProcessingException;
com.couchbase.client.deps.com.fasterxml.jackson.databind.JsonMappingException;***

What would be the best possible options one could follow to handle such an upgrading process in relation to Spring Boot and Couchbase projects done with the prior version?

0 Answers
Related