I have configuration something like this when to try to upgrade to the 12.1 version getting error,
Check that your configuration is up-to date for Infinispan '12.1.4.Final' and if you have the proper dependency in the classpath: org.infinispan.commons.CacheConfigurationException: ISPN000327: Cannot find a parser for element 'named-cache' in namespace 'urn:infinispan:config:12.1'.
I could not find the replacement for the below config, please input your suggestion.
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd"
xmlns="urn:infinispan:config:5.1">
<namedCache name="test-cache">
<eviction strategy="LIRS" maxEntries="1000"/>
<expiration lifespan="5400000" maxIdle="4400000"/>
</namedCache>
</infinispan>
This is the current version I am trying to upgrade.
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>12.1.7.Final</version
</dependency>
CodePudding user response:
The documentation suggests this:
<infinispan>
<cache-container>
<!-- Configures a local cache. -->
<local-cache name="local"/>
</cache-container>
</infinispan>
This would give you a local cache, analogous elements exist for replicated-cache
, distributed-cache
. etc. Eviction nowadays seems to be handled by the memory element, with REMOVE
replacing the long-deprecated (now gone) strategies like LIRS
, etc. (not clue why or if a more fine-grained control over the strategy is still possible), see Eviction in the documentation:
<local-cache name="maximum_count">
<encoding media-type="application/x-protostream"/>
<memory max-count="500" when-full="REMOVE"/>
</local-cache>
Expiration still works like before, it seems.
While xsd schemas tend to be pretty hard to read, the one for this xml is at least not horribly complicated but mostly straight-forward.