Expiry Policies

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Expiry Policies

Davydov, Mark
Good morning!

I am trying to evaluate Apache Ignite for our production system. So far we like the product, but we are having problem with configuring Expiry Policies. We need to expire data from cache after 5 seconds but can't figure out how to do it. The records are still there after hours. We also enabled eagerTtl to true with no luck.

Please advice.


We are running Apache Ignite 2.8.1 on Ubuntu 18.4 using Java 11, C++ Apache Ignite client.

Here is our configuration.


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration"/>

    <bean class="org.apache.ignite.configuration.CacheConfiguration">
        <property name="expiryPolicyFactory">
            <bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
                <constructor-arg>
                    <bean class="javax.cache.expiry.Duration">
                        <constructor-arg value="SECONDS"/>
                        <constructor-arg value="5"/>
                    </bean>
                </constructor-arg>
            </bean>
        </property>
        <property name="eagerTtl" value="true"/>
    </bean>

</beans>

Reply | Threaded
Open this post in threaded view
|

Re: Expiry Policies

dmagda
Hi Mark,

What name do you use to access this cache from code? The name is not set in
your config file.

You can refer to this configuration sample that works like a charm:
https://www.gridgain.com/docs/latest/developers-guide/configuring-caches/expiry-policies#configuration

-
Denis


On Wed, Jul 22, 2020 at 7:45 AM Davydov, Mark <
[hidden email]> wrote:

> Good morning!
>
> I am trying to evaluate Apache Ignite for our production system. So far we
> like the product, but we are having problem with configuring Expiry
> Policies. We need to expire data from cache after 5 seconds but can't
> figure out how to do it. The records are still there after hours. We also
> enabled eagerTtl to true with no luck.
>
> Please advice.
>
>
> We are running Apache Ignite 2.8.1 on Ubuntu 18.4 using Java 11, C++
> Apache Ignite client.
>
> Here is our configuration.
>
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
>        http://www.springframework.org/schema/beans/spring-beans.xsd">
>
>     <bean id="grid.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration"/>
>
>     <bean class="org.apache.ignite.configuration.CacheConfiguration">
>         <property name="expiryPolicyFactory">
>             <bean class="javax.cache.expiry.CreatedExpiryPolicy"
> factory-method="factoryOf">
>                 <constructor-arg>
>                     <bean class="javax.cache.expiry.Duration">
>                         <constructor-arg value="SECONDS"/>
>                         <constructor-arg value="5"/>
>                     </bean>
>                 </constructor-arg>
>             </bean>
>         </property>
>         <property name="eagerTtl" value="true"/>
>     </bean>
>
> </beans>
>
>