You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Charlin S <Ch...@hotelhub.com> on 2022/06/16 13:04:22 UTC

expiryPolicyFactory not working

We have a requirement to set expiry policy explicitly.
I have set the expiryPolicyFactory for some caches, but the data is  not
removed from the cache after expiryPolicyFactory time out.
Server bean xml :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/util

http://www.springframework.org/schema/util/spring-util.xsd">
  <bean id="expireCache"
class="org.apache.ignite.configuration.CacheConfiguration" abstract="true">
    <property name="expiryPolicyFactory">
        <bean class="javax.cache.expiry.CreatedExpiryPolicy"
factory-method="factoryOf">
            <constructor-arg>
                <bean class="javax.cache.expiry.Duration">
                    <constructor-arg value="MINUTES"/>
                    <constructor-arg value="60"/>
                </bean>
            </constructor-arg>
       </bean>
    </property>
  </bean>
  <bean class="org.apache.ignite.configuration.IgniteConfiguration">
    <property name="clientMode" value="false"/>
    <property name="clientFailureDetectionTimeout" value="120000"/>
    <property name="igniteInstanceName"
value="Common-DynamicGrid-Beta-V291"/>
    <property name="longQueryWarningTimeout" value="4000"/>
    <property name="failureDetectionTimeout" value="120000"/>
    <property name="localHost" value="server IP"/>
    <property name="segmentationPolicy" value="RESTART_JVM"/>
    <property name="segmentCheckFrequency" value="20000"/>
    <property name="segmentationResolveAttempts" value="10"/>
    <property name="discoverySpi">
    <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">
<property name="localPort" value="47500"/>
<property name="ipFinder">
 <bean
class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
<property name="addresses">
 <list>
<value>Server1 IP:47500</value>
<value>Server2 IP:47500</value>
 </list>
</property>
 </bean>
</property>
 </bean>
</property>
<property name="cacheConfiguration">
<list>
<bean parent="expireCache">
<property name="name" value="RateResponse"/>
</bean>
<bean parent="expireCache">
<property name="name" value="OfferHistoryModel"/>
</bean>
<bean parent="expireCache">
<property name="name" value="OfferHistoryDetailModel"/>
</bean>
<bean parent="expireCache">
<property name="name" value="FaxStatusBookingModel"/>
</bean>
</list>
</property>
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="defaultDataRegionConfiguration">
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="Common_Dynamic_Data_Region"/>
<property name="initialSize" value="#{1L * 1024 * 1024 * 1024}"/>
<property name="maxSize" value="#{10L * 1024 * 1024 * 1024}"/>
<property name="pageEvictionMode" value="RANDOM_2_LRU"/>
<property name="evictionThreshold" value="0.7"/>
<property name="emptyPagesPoolSize" value="65536"/>
</bean>
</property>
</bean>
</property>
<property name="communicationSpi">
<bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
<property name="sharedMemoryPort" value="-1"/>
<property name="localPort" value="47605"/>
</bean>
</property>
  </bean>
</beans>

Regards,
Charlin