Search code examples
ttlgemfiregeodecaching-proxy

Gemfire CACHING PROXY


I am using CACHING_PROXY for a Client Gemfire region, and it looks like the Caching that happens on the client is not honoring the TTL set for the entry in the backing region on the Server. Is there a way to have the Caching Proxy honor the TTL for the entry on the backing server region.


Solution

  • When you have a CACHING_PROXY region, ideally, you would want to keep that upto date with all changes on the server. The mechanism to achieve that in Geode/GemFire is Register Interest, which will push all updates from the server to the client for some/all keys.

    To use this feature, you will have to:
    1. Enable subscriptions when you create the client

    ClientCacheFactory ccf = new ClientCacheFactory();
    ccf.setPoolSubscriptionEnabled(true);
    

    2. Register interest on keys interested:

     myRegion.registerInterestRegex("*", InterestResultPolicy.NONE);
    

    For more details, please see the documentation.