1

I am using Apache Ignite 2.8.0. I see that when persistence is enabled, cache expiry is not working. But according to documentation it should: https://apacheignite.readme.io/docs/expiry-policies.

I am using Java Thin client. How can I set expire policy for my thin client cache, when persistence is enabled? and whether thin client cache supports the expire polices or not?

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152

1 Answers1

0

Thin client doesn't support creating a cache w/expiry policies.

see: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/client/ClientCacheConfiguration.html

You can create a cache with expiry via config on a server or a thick client and then use that same cache in the thin client.

i.e.

on the server/thick client:

    CacheConfiguration cacheCfg = new CacheConfiguration("expiringCache");

    cacheCfg.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, 10)));

on thin client:

    IgniteClient igniteClient = Ignition.startClient(cfg)
    ClientCache cache  = igniteClient.cache("expiringCache");

Anything put into this cache will expire in 10 seconds.

Alex K
  • 841
  • 4
  • 5
  • According to JavaDoc you can actually set it. It works locally but not remotely against a Kubernetes cluster. It's very weird. – Daniel May 27 '20 at 14:48