Networking ActiveMQ网络代理

Networking ActiveMQ网络代理,networking,activemq,broker,Networking,Activemq,Broker,我正在尝试创建一个ActiveMQ网络,它将由2个代理组成。我已经完成了相关指南中描述的配置(http://activemq.apache.org/networks-of-brokers.html) 是否有人成功设置了由两个或多个ActiveMQ代理组成的网络?如果使用,则需要指定构成代理网络的代理的所有IP <networkConnector name="HA Queue" uri="static:(tcp://host1:61616,tcp://host2:61616)"/>

我正在尝试创建一个ActiveMQ网络,它将由2个代理组成。我已经完成了相关指南中描述的配置(http://activemq.apache.org/networks-of-brokers.html)

是否有人成功设置了由两个或多个ActiveMQ代理组成的网络?

如果使用,则需要指定构成代理网络的代理的所有IP

 <networkConnector name="HA Queue" uri="static:(tcp://host1:61616,tcp://host2:61616)"/>

此外,请尝试以以下方式指定传输连接器:

    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://0.0.0.0:61616" />
    </transportConnectors>

这是使用ActiveMQ时非常常见的事情。您可以在${ACTIVEMQ_HOME}/conf目录(ACTIVEMQ-static-network-broker1.xml和ACTIVEMQ-static-network-broker2.xml)中获得一个示例配置来建立代理网络

从我所看到的配置的名称空间是错误的。应改为:

<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-2.0.xsd
    http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1">
    <!-- other stuff goes here -->
  </broker>

</beans>

需要注意的关键是,这是一个Spring配置(http://www.springframework.org/schema/beans)具有定义AMQ代理的XBean配置的(http://activemq.apache.org/schema/core).


我还想附和srodriguez所说的,使用0.0.0.0作为transportConnector的主机名。

感谢您的回复,因为xml标记上出现了错误,奇怪的是,在linux下我没有收到任何错误消息。当我在windows下运行它时,在xml标记上出现了错误。我没有在静态声明中指定所有IP,就我所知,网络是按属性形成的。
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://0.0.0.0:61616" />
    </transportConnectors>
<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-2.0.xsd
    http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

  <broker xmlns="http://activemq.apache.org/schema/core" brokerName="static-broker1">
    <!-- other stuff goes here -->
  </broker>

</beans>