Class ClusterOptions

  • public class ClusterOptions
    extends Object
    Allows specifying custom options when connecting to the cluster.
    • Method Detail

      • environment

        public ClusterOptions environment​(ClusterEnvironment environment)
        Sets the ClusterEnvironment to use with this cluster.

        The caller is responsible for shutting down the environment after all clusters sharing it have disconnected.

        Use this method when sharing an environment between multiple clusters. In all other cases, prefer environment(Consumer).

      • environment

        public ClusterOptions environment​(Consumer<ClusterEnvironment.Builder> environmentCustomizer)
        Sets a callback that configures the ClusterEnvironment owned by this cluster.

        The cluster will manage the lifecycle of the environment, and automatically shut it down when the cluster is disconnected.

        This is the recommended way to configure the cluster environment unless you need to share an environment between multiple clusters.