我们已经从Widlfly 10迁移到Wildfly 14。我们的Infinispan(7.0) web缓存容器的配置有一个问题。在以前的版本中,它可以将模式设置为ASYNC。这是不可能的,文档声明:
从6.0.0起就不再推荐了。此属性将被忽略。所有缓存模式都将被视为同步。若要执行异步缓存操作,请使用Infinispan的异步缓存API。
我们不希望现在是默认的模式同步,所以我们如何通过配置独立-ha.xml使用Infinispan的异步缓存API??
野生蝇10配置
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<distributed-cache name="dist" mode="ASYNC" l1-lifespan="0" owners="2">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
<distributed-cache name="concurrent" mode="SYNC" l1-lifespan="0" owners="2">
<file-store/>
</distributed-cache>
</cache-container>野生蝇14配置
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
</cache-container>发布于 2019-01-14 21:59:42
在WF 14中,对会话缓存的修改是在响应刷新之后提交的,因此从用户的角度来看,所有缓存访问实际上都是异步的。
此外,ASYNC缓存模式与Infinispan的异步缓存API不一样。
异步缓存API仅与同步缓存模式相关。
在WildFly论坛上也提出了同样的问题。请参阅https://developer.jboss.org/thread/279453
https://stackoverflow.com/questions/54147643
复制相似问题