Details
-
Improvement
-
Resolution: Fixed
-
Major
-
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)));
|