2

We used Couchbase java-client version 2.7.20 in our project, now as a part of migration of JDK11 -> JDK17, we want to migrate Couchbase client also to the latest version, which is 3.3.2

But I could not figure it out how to deal with openBucket which takes two arguments in SDK3, I read documentation from Couchbase about migration, but there explained migration of openBucket with only 1 argument name, but without password argument

here is sample from our existing project code, openBucket(bucketName, bucketPassword)

@Bean(name = "exampleBucket")
    public Bucket exampleBucket() {
        return getCouchbaseCluster().openBucket("bucket_name", "bucket_password");
    }

//getCouchbaseCluster() -> custom method that creates and returns Cluster

1 Answers1

1

In Couchbase SDK 3, the openBucket method takes only the bucket name. Authorization is handled by role-based access control. Instead of specifying a password for the bucket, you specify a username and password when connecting to the cluster.

dnault
  • 8,340
  • 1
  • 34
  • 53
  • Thank you @dnault Previously we used to create separate users for every bucket, now we are implementing role based authorization ,so yeah, we are going to use openBucket with one argument which is bucket name. You answer was really helpful, appreciate that! – Komiljon Aliyev Jul 18 '22 at 21:30