问题
I am using infinispan-5.1.6.FINAL as a remote-cache server and hot-rod protocol to access it. but found the is not working as intended, i.e cached value of a key is not evicted after 1ms as per the config below
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:infinispan="urn:infinispan:config:5.1"
xsi:schemaLocation="urn:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd">
<global >
<globalJmxStatistics enabled="true"/>
</global>
<namedCache name="my-cache">
<expiration lifespan="1" maxIdle="1" reaperEnabled="true" wakeUpInterval="1" />
</namedCache>
</infinispan>
I exploded war (infinispan-5.1.6.FINAL/modules/rest/infinispan-server-rest.war), saved the above config, changed web.xml to use it and deployed in tomcat 6.0.32
I was able to put into the cache and retrieve from it, by this resource
http://localhost:8080/infinispan-server-rest/rest/my-cache/1
but the entry is not evicted even after 10mins. btw the same config was working in embedded-cache mode.
did I miss something? how can I get this working?
回答1:
The default behaviour of the REST server is to store entries indefinitely, regardless of the cache settings. If you want to use the default expiration settings of the cache, you have to specify timeToLiveSeconds=0
and maxIdleTimeSeconds=0
.
This may change in future releases, see https://community.jboss.org/message/796785#796785.
来源:https://stackoverflow.com/questions/14760367/infinispan-cache-server-expiration-failure