0
有沒有辦法將activemq.xml(如共享存儲)中定義的一些屬性設置爲啓動參數?ActiveMQ設置屬性與啓動參數
<kahaDB directory="${data}/kahadb"/>
與-Dparam =值運行的amq似乎並沒有工作
有沒有辦法將activemq.xml(如共享存儲)中定義的一些屬性設置爲啓動參數?ActiveMQ設置屬性與啓動參數
<kahaDB directory="${data}/kahadb"/>
與-Dparam =值運行的amq似乎並沒有工作
我覺得很奇怪,這並不爲你工作,比如我們目前正在使用以下Broker配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="locations">
<list>
<value>classpath:activemq.properties</value>
<value>file:///${user.home}/activemq.properties</value>
<value>file:///#{systemProperties['activemq.properties']}</value>
</list>
</property>
</bean>
<broker useJmx="${activemq.expose.jmx}" persistent="false"
brokerName="${activemq.brokerName}"
xmlns="http://activemq.apache.org/schema/core">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue=">" enableAudit="false">
<networkBridgeFilterFactory>
<conditionalNetworkBridgeFilterFactory replayWhenNoConsumers="true"/>
</networkBridgeFilterFactory>
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="${activemq.memoryUsage}" />
</memoryUsage>
<tempUsage>
<tempUsage limit="${activemq.tempUsage}" />
</tempUsage>
</systemUsage>
</systemUsage>
<networkConnectors>
<networkConnector
name="queues"
uri="static:(${activemq.otherBrokers})"
networkTTL="3"
decreaseNetworkConsumerPriority="true"
conduitSubscriptions="false" >
<excludedDestinations>
<topic physicalName=">" />
</excludedDestinations>
</networkConnector>
<networkConnector
name="topics"
uri="static:(${activemq.otherBrokers})"
networkTTL="3"
decreaseNetworkConsumerPriority="true"
conduitSubscriptions="true" >
<excludedDestinations>
<queue physicalName=">" />
</excludedDestinations>
</networkConnector>
</networkConnectors>
<transportConnectors>
<!-- expose a TCP transport for clients to use -->
<transportConnector
uri="${activemq.protocol}${activemq.host}:${activemq.tcp.port}"
updateClusterClients="true"
rebalanceClusterClients="true" />
<transportConnector
uri="${activemq.websocket.protocol}${activemq.websocket.host}:${activemq.websocket.port}"
updateClusterClients="true"
rebalanceClusterClients="true" />
</transportConnectors>
</broker>
</beans>
這裏通常是從給定的屬性文件讀取屬性,但是我經常使用直接的-D JMV系統屬性來替代屬性文件中的某些測試,並且從未遇到任何問題。我想你可以嘗試#{systemProperties ['property.name']}的略複雜的語法來專門設置給定屬性是系統屬性而不是來自佔位符。
最後一點:您使用的是哪個版本的ActiveMQ,以及該版本使用哪個版本的Spring?我認爲整個佔位符語法都是在Spring 3.1的某個地方添加的,所以真的很早以前,但這是我能想象爲什麼這不適合你的唯一原因。