Class MultiClusterProperties
The file carries policy, not connections. Cluster proxies are built by the application and passed in, so the per-cluster keys here are topology metadata only - site, locality, read weight. There is deliberately no way to put lookup locators or credentials in this file: the application owns connecting to its spaces.
Map<String, GigaSpace> proxies = Map.of("us-east", east, "us-west", west);
MultiClusterGigaSpace gigaSpace =
MultiClusterProperties.configurerFrom(props, proxies).gigaSpace();
Format
multicluster.name = orders # optional, used for JMX and logs multicluster.clusters = us-east, us-west # order matters: it is the default priority multicluster.cluster.us-east.site = us-east-1 # optional multicluster.cluster.us-east.local = true # optional topology metadata multicluster.cluster.us-east.weight = 3 # optional, for weighted balancing multicluster.activeCluster = us-east multicluster.readActiveCluster = us-west # optional: READ_ACTIVE reads go here multicluster.priority = us-east, us-west multicluster.writeMode = WRITE_SYNC multicluster.readMode = READ_ROUND_ROBIN multicluster.failoverPolicy = AUTO_FAILOVER_NEXT_AVAILABLE multicluster.transactionPolicy = ACTIVE_ONLY_WHEN_TRANSACTIONAL multicluster.quiescePolicy = RETRY_UNTIL_ACTIVE multicluster.failureThreshold = 3 multicluster.failureWindow = 30s multicluster.requiredSuccessCount = 0 multicluster.takeFanOutOnMiss = false multicluster.asyncQueueCapacity = 10000 multicluster.fanOutTasks = false multicluster.clearSumsAcrossClusters = true multicluster.jmx = true
Unknown keys are an error
A misspelled key that is quietly ignored is the worst kind of configuration bug: the file saysreadMode=READ_ROUND_ROBIN and production serves every read from one cluster. Every key is validated
and anything unrecognised is rejected by name.
Durations accept 30s, 500ms, 5m, or an ISO-8601 form like PT30S.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MultiClusterConfigconfigFrom(Map<String, String> properties) Reads the routing configuration only - no topology.static MultiClusterConfigconfigFrom(Properties properties) Reads the routing configuration only - no topology.Builds a configurer from a plain map - e.g.configurerFrom(Properties properties, Map<String, ? extends GigaSpace> spaceProxies) Builds a configurer from properties, wiring in the cluster proxies the application built.static ClusterDescriptordescriptorFor(Map<String, String> properties, String cluster) The topology metadata declared for one cluster: site, locality and read weight, defaulted when the file says nothing about them.
-
Method Details
-
configurerFrom
public static MultiClusterGigaSpaceConfigurer configurerFrom(Properties properties, Map<String, ? extends GigaSpace> spaceProxies) Builds a configurer from properties, wiring in the cluster proxies the application built.multicluster.clusterslists the cluster names, and every listed name must have a proxy inspaceProxies- a name in the file with no proxy behind it is a configuration error, not something to skip silently.- Throws:
IllegalArgumentException- if a key is unrecognised, or a listed cluster has no proxy
-
configurerFrom
-
configFrom
Reads the routing configuration only - no topology.For the common Spring case of wiring clusters as beans while keeping the modes in a file:
configurer.cluster(...).config(MultiClusterProperties.configFrom(props)). -
configFrom
Reads the routing configuration only - no topology.- See Also:
-
descriptorFor
The topology metadata declared for one cluster: site, locality and read weight, defaulted when the file says nothing about them.
-