Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1917

Simplify ClusterEnvironment configuration

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.2.6
    • None
    • None
    • None
    • 1

    Description

      Suggested release note text:

      You can now configure properties of the ClusterEnvironment without having to build and shut down the environment. The new  ClusterOptions.environment(Consumer<ClusterEnvironment.Builder>) method lets you configure properties of a ClusterEnvironment owned by the Cluster, so you don't need to manage the environment yourself.

      Most of the Java SDK's configuration options are related to the cluster environment. Historically this has meant that if you wanted to change any of the default options, you needed to create a ClusterEnvironment and remember to shut it down after the client disconnects, even if you're not sharing the environment between clusters.

      This change adds a new method that lets you configure the environment without having to manage it yourself:

      ClusterOptions.environment(Consumer<ClusterEnvironment.Builder>)

      Example usage:
       

      Cluster cluster = Cluster.connect("localhost", clusterOptions(username, password)
          .environment(env -> env.ioConfig().captureTraffic(ServiceType.MANAGER)));
      

       

       

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            david.nault David Nault
            david.nault David Nault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty