builder

Returns a new ClusterEnvironment.Builder. If you provide an environment config DSL block, the returned builder has settings configured by the block. Otherwise the builder has default settings, which you can customize by calling methods on the builder.

Pass the returned builder to one of the Cluster.connect methods, or call build and pass the resulting ClusterEnvironment to Cluster.connectUsingSharedEnvironment. Remember: if you call build() yourself, you are responsible for shutting down the environment after disconnecting the clusters that share it.

Parameters

configBlock

an optional lambda for configuring the new builder using cluster environment config DSL.

Samples

// Create builder with default settings
val builder = ClusterEnvironment.builder()
// Preconfigure builder using DSL
val builder = ClusterEnvironment.builder {
    retryStrategy = FailFastRetryStrategy.INSTANCE
    io {
        maxHttpConnections = 16
    }
}