34.6. Configure Partition Handling

In Red Hat JBoss Data Grid, partition handling is disabled as a default.
Declarative Configuration (Library Mode)

Enable partition handling declaratively as follows:

<namedCache name="myCache">
  <clustering mode="distribution">
    <partitionHandling enabled="true" />
  </clustering>
</namedCache>
Programmatic Configuration (Library Mode)

Enable partition handling programmatically as follows:

ConfigurationBuilder dcc = new ConfigurationBuilder();
dcc.clustering().partitionHandling().enabled(true);
Declarative Configuration (Remote Client-server Mode)

Enable partition handling declaratively in remote client-server mode by using the following configuration:

<subsystem xmlns="urn:infinispan:server:core:6.2" default-cache-container="clustered">
    <cache-container name="clustered" default-cache="default" statistics="true">
        <distributed-cache name="default" mode="SYNC" segments="20" owners="2" 
                           remote-timeout="30000" start="EAGER">
            <partition-handling enabled="true" />
            <locking isolation="READ_COMMITTED" acquire-timeout="30000" 
                     concurrency-level="1000" striping="false"/>
            <transaction mode="NONE"/>
        </distributed-cache>
    </cache-container>
</subsystem>