首页 > 解决方案 > Infinispan 配置 XML 中的变量替换

问题描述

我有一个使用 infinispan 进行缓存的 jboss wildfly 应用程序服务器。我目前正在迁移配置文件,我有点卡住了。在旧版本的 jboss 中,cache-config.xml 可以使用模板样式变量替换( ${foo}/dir )。在 wildfly 中使用相同的技术似乎不起作用。我最终得到了名为“${foo}/dir”而不是“foo/dir”的文件夹。我需要能够为生产和测试构建更改这些变量,因此硬编码它们将不起作用。有谁知道如何在 wildfly 应用程序中处理这个问题?

作为参考,这是我的 cache-config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<infinispan xmlns="urn:infinispan:config:9.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:9.0
http://www.infinispan.org/schemas/infinispan-config-9.0.xsd">
   <cache-container name="product-cache" default-cache="local">
   <jmx domain="com.tura.product"/>
   
   
   <local-cache name="local">
        
   <locking  isolation="REPEATABLE_READ" acquire-timeout="15000" striping="false" concurrency-level="1000"/>
   <transaction mode="BATCH" />

        <persistence passivation="true">
            <file-store fetch-state="true" purge="true">         
              <property name="location">${jboss.server.data.dir}${/}product</property> 
            </file-store>
        </persistence>
        
        <!-- enable lazy deserialization -->
    <memory>
            <binary />
    </memory>
   </local-cache>
 </cache-container>
</infinispan>

标签: javaxmlcachingwildflyinfinispan

解决方案


推荐阅读