Package org.openspaces.core.multicluster


package org.openspaces.core.multicluster
Multi-cluster GigaSpace proxy (PIC-6085).

A client-side GigaSpace implementation that fronts several already-deployed remote spaces - one per cluster / site - and routes each operation to one or more of them according to the configured write mode, read mode and failover policy. Because MultiClusterGigaSpace extends GigaSpace, application code does not change: only the bean or factory that produces the GigaSpace is swapped.

It is built the way any other GigaSpace is built - hand the configurer the clusters, call gigaSpace():

SpaceProxyConfigurer east = new SpaceProxyConfigurer("mySpace").lookupLocators("east-host:4174");
SpaceProxyConfigurer west = new SpaceProxyConfigurer("mySpace").lookupLocators("west-host:4174");

MultiClusterGigaSpace gigaSpace = new MultiClusterGigaSpaceConfigurer(
                Map.of("us-east", east, "us-west", west))
        .activeCluster("us-east")
        .writeMode(WriteMode.WRITE_SYNC)
        .readMode(ReadMode.READ_ROUND_ROBIN)
        .gigaSpace();

The application connects; the proxy routes. Cluster proxies - whether handed in as GigaSpace instances or built by the configurer from the SpaceConfigurers you passed - are never owned by the multi-cluster proxy, exactly as a GigaSpace does not own the SpaceConfigurer behind it. Closing the multi-cluster proxy releases only what it created itself: the write executors and the deferred-mutation queue.

This package is the supported surface: the interface itself, MultiClusterGigaSpaceConfigurer and MultiClusterGigaSpaceFactoryBean for building one, ClusterDescriptor for per-cluster topology metadata, MultiClusterConfig and MultiClusterProperties for the routing knobs, and MultiClusterStats for what it reports - read-only, since the proxy is what writes those counters. The event and exception sub-packages are part of it too.

internal and everything beneath it are implementation - the router, the topology registry, operation classification, read selectors, write executors, health, failover, and the stats recorder. They are subject to change without notice, in the same way com.gigaspaces.internal.client.spaceproxy is relative to IJSpace.

Two things to know before using it

  • Fan-out modes are not a distributed transaction. Inside an active transaction the proxy narrows to the active cluster, or refuses, depending on the configured transaction policy.
  • Either the proxy fans mutations out, or a WAN Gateway replicates them - doing both applies each mutation twice.