public class ClusterSettings
extends java.lang.Object
implements scala.Product, scala.Serializable
Config
values required by an ActorSystem
to boot. It configures mainly
four parameters of an ActorSystem
, namely :
- name (Name is defaulted to a constant value so that ActorSystem joins the cluster while booting) - akka.remote.netty.tcp.hostname (The hostname to boot an ActorSystem on) - akka.remote.netty.tcp.port (The port to boot an ActorSystem on) - akka.cluster.seed-nodes (Seed Nodes of the cluster)
ClusterSettings require three values namely : - interfaceName (The network interface where cluster is formed.) - clusterSeeds (The host address of the seedNode of the cluster) - clusterPort (Specify port on which to start this service)
The config values of the ActorSystem
will be evaluated based on the above three settings as follows :
- akka.remote.netty.tcp.hostname
will be ipV4 address based on interfaceName
from csw.services.location.internal.Networks
- akka.remote.netty.tcp.port
will be a random port or if clusterPort
is specified that value will be picked
- akka.cluster.seed-nodes
will pick values of clusterSeeds
If none of the settings are provided then defaults will be picked as follows :
- akka.remote.netty.tcp.hostname
will be ipV4 address from csw.services.location.internal.Networks
- akka.remote.netty.tcp.port
will be a random port
- akka.cluster.seed-nodes
will be empty
and an ActorSystem
will be created and a cluster will be formed with no Seed Nodes. It will self join the cluster.
ClusterSettings
can be given in three ways :
- by using the api
- by providing system properties
- or by providing environment variables
If a ClusterSettings
value e.g. clusterPort is provided by more than one ways, then the precedence of consumption will be first from
- System Properties
- then from Environment variable
- and then from ClusterSettings
api
Constructor and Description |
---|
ClusterSettings(java.lang.String clusterName,
scala.collection.immutable.Map<java.lang.String,java.lang.Object> values) |
Modifier and Type | Method and Description |
---|---|
abstract static boolean |
canEqual(java.lang.Object that) |
java.lang.String |
clusterName() |
com.typesafe.config.Config |
config() |
abstract static boolean |
equals(java.lang.Object that) |
java.lang.String |
hostname() |
java.lang.String |
interfaceName() |
ClusterSettings |
joinLocal(int port,
int... ports) |
ClusterSettings |
joinLocal(int port,
scala.collection.Seq<java.lang.Object> ports) |
ClusterSettings |
joinSeeds(java.lang.String seeds) |
scala.Option<java.lang.Object> |
managementPort() |
ClusterSettings |
onPort(int port) |
int |
port() |
abstract static int |
productArity() |
abstract static java.lang.Object |
productElement(int n) |
static scala.collection.Iterator<java.lang.Object> |
productIterator() |
static java.lang.String |
productPrefix() |
scala.collection.immutable.List<java.lang.String> |
seedNodes() |
scala.collection.immutable.List<java.lang.String> |
seeds() |
akka.actor.ActorSystem |
system() |
scala.collection.immutable.Map<java.lang.String,java.lang.Object> |
values() |
ClusterSettings |
withEntries(scala.collection.immutable.Map<java.lang.String,java.lang.Object> entries) |
ClusterSettings |
withInterface(java.lang.String name) |
ClusterSettings |
withManagementPort(int port) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ClusterSettings(java.lang.String clusterName, scala.collection.immutable.Map<java.lang.String,java.lang.Object> values)
public abstract static boolean canEqual(java.lang.Object that)
public abstract static boolean equals(java.lang.Object that)
public abstract static java.lang.Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<java.lang.Object> productIterator()
public static java.lang.String productPrefix()
public ClusterSettings joinLocal(int port, int... ports)
public java.lang.String clusterName()
public scala.collection.immutable.Map<java.lang.String,java.lang.Object> values()
public ClusterSettings withEntries(scala.collection.immutable.Map<java.lang.String,java.lang.Object> entries)
public ClusterSettings withInterface(java.lang.String name)
public ClusterSettings withManagementPort(int port)
public ClusterSettings joinSeeds(java.lang.String seeds)
public ClusterSettings joinLocal(int port, scala.collection.Seq<java.lang.Object> ports)
public ClusterSettings onPort(int port)
public java.lang.String interfaceName()
public java.lang.String hostname()
public int port()
public scala.Option<java.lang.Object> managementPort()
public scala.collection.immutable.List<java.lang.String> seeds()
public scala.collection.immutable.List<java.lang.String> seedNodes()
public com.typesafe.config.Config config()
public akka.actor.ActorSystem system()