2011-05-04

ActiveMQ 設定檔需知

ActiveMQ 的 設定 都來自於 activemq.xml這個設定檔


預設的設定 一定有不足之處 所以我打算加些功能 使ActiveMQ效能更好


這次要做的是 ActiveMQ Broker 間的串連


 


所以在 broker tag 內 加入以下


<networkConnectors>
    <networkConnector name="linkToBrokerB"
        uri="static:(tcp://61.220.210.59:61616)"
    />           
</networkConnectors>


 


結果run activemq時 卻出現了 org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException


nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'networkConnectors'. .....


最後發現 原來 Spring 內的設定 要按照字母順序阿


請參考 http://activemq.2283324.n4.nabble.com/SAXParseException-using-default-activemq-xml-td2364902.html


所以我將上述文字放在 M 開頭 tag 下方 就正常了