【发布时间】:2015-07-15 16:53:46
【问题描述】:
我使用 WildFly 8.2 和 Immutant 2.1(应用程序在 Clojure 中)
每次我在 WildFly 集群中重新部署我的应用程序时,它的 Infinispan Web 缓存容器都会重新启动,并且所有用户会话都会丢失。
是否可以不重新启动缓存容器,或者在重新部署之前将数据刷新到磁盘?
提前致谢
统一更新: 感谢 sprockets 的回答,我可以找到可以满足我需要的 Web 容器配置:
<cache-container name="web" default-cache="repl" module="org.wildfly.clustering.web.infinispan" aliases="standard-session-cache">
<transport lock-timeout="60000"/>
<replicated-cache name="repl" batching="true" mode="ASYNC">
<file-store preload="true" passivation="false" purge="false" relative-to="jboss.home.dir" path="infinispan-file-store">
<write-behind/>
</file-store>
</replicated-cache>
</cache-container>
问题是 Web 容器对其配置非常挑剔,如果您使用不兼容的设置,则会引发信息量不大的异常。 所以基本上,你只需要添加
<file-store preload="true" passivation="false" purge="false" relative-to="jboss.home.dir" path="infinispan-file-store">
<write-behind/>
</file-store>
到容器配置。
【问题讨论】:
标签: caching jboss clojure wildfly infinispan