I have a Peer-Peer gemfire topology with roughly 15 peers. I use Spring-data-gemfire to initialize the gemfire context and all regions are Replicated for fastest possible access.
Each peer only needs access to a small subset of all the Gemfire regions. I would like each peer to register interest only in the regions it need and avoid all unnecessary traffic. Is there a way to do this using Spring-data-gemfire?
Versions used: Spring 3.2.1 Gemfire: 6.6.3.2 Spring-data-gemfire: 1.2.2
"Each peer only needs access to a small subset of all the Gemfire regions."
By "small subset" do you mean data or in fact, just certain "REPLICATE" Regions?
If the later, then only configure a peer member to have the REPLICATE Region (e.g. X) that needs that Region (e.g. X). For instance...
Member A - REPLICATE Region X, Y, Z Member B - REPLICATE Region X, Y Member C - REPLICATE Region Z
Then, only those members having the REPLICATE Region will actually receive (all) data and events for that Region.
If you want to control the actual contents of the Region (i.e. data) then know that, by default, a REPLICATE Region is a full replicate (all or nothing strategy), in that it distributes all data/events to all members hosting the Region. Or in the GemFire UG's own words...
"Replicated regions always receive all events from peers and require no further configuration."
(http://gemfire.docs.pivotal.io/latest/userguide/developing/events/configure_p2p_event_messaging.html)
Also note... there is no "Register Interest" feature for peers. Register Interests is between client and server. Another client/server "interests" type option is CQs.
However, you can create a Region with a different Data Policy and use Subscription to get only the data you want. E.g. ...
<gfe:partitioned-region id="X" ...>
<gfe:subscription type="CACHE_CONTENT"/>
</gfe:partitioned-region>
Technically, you can used with as well, but I am uncertain what happens in this scenario, actually.
Also, I am not certain about the finer grained controls that client Register Interests and CQs give you when using peer Subscription in GemFire. My knowledge is limited in this area.
See...
http://gemfire.docs.pivotal.io/latest/userguide/developing/distributed_regions/chapter_overview.html
And...
http://gemfire.docs.pivotal.io/latest/userguide/developing/events/how_cache_events_work.html
As well as the link above for more details.
Hope this helps.