Configuring Peer-to-Peer Event Messaging
You can receive events from cluster peers for any region that is not a local region. Local regions receive only local cache events.
Peer distribution is done according to the region’s configuration.
- Replicated regions always receive all events from peers and require no further configuration. Replicated regions are configured using the
REPLICATE
region shortcut settings. For non-replicated regions, decide whether you want to receive all entry events from the distributed cache or only events for the data you have stored locally. To configure:
To receive all events, set the
subscription-attributes
interest-policy
toall
:<region-attributes> <subscription-attributes interest-policy="all"/> </region-attributes>
To receive events just for the data you have stored locally, set the
subscription-attributes
interest-policy
tocache-content
or do not set it (cache-content
is the default):<region-attributes> <subscription-attributes interest-policy="cache-content"/> </region-attributes>
For partitioned regions, this only affects the receipt of events, as the data is stored according to the region partitioning. Partitioned regions with interest policy of
all
can create network bottlenecks, so if you can, run listeners in every member that hosts the partitioned region data and use thecache-content
interest policy.
Note: You can also configure Regions using the gfsh command-line interface. See Region Commands.