如何测试HornetQ集群已正确设置?

时间:2014-02-04 07:42:22

标签: java jboss cluster-computing hornetq

我是HornetQ的新手,试图在我的本地网络上设置一个包含2个hornetq实例的集群。我从confif / stand-alone / clustered复制了配置文件,并在两个实例上使用它:

<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

    <journal-min-files>10</journal-min-files>
    <journal-file-size>20971520</journal-file-size>
    <journal-buffer-timeout>50000000</journal-buffer-timeout>
    <persistence-enabled>false</persistence-enabled>
    <connectors>

        <connector name="netty">
            <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
            <param key="host"  value="127.0.0.1"/>
            <param key="port"  value="5445"/>
            <param key="use-nio" value="true"/>

        </connector>
        <connector name="netty-throughput">
            <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
            <param key="host"  value="127.0.0.1"/>
            <param key="port"  value="5445"/>
            <param key="use-nio" value="true"/>


        </connector>
    </connectors>
    <acceptors>

        <acceptor name="netty">
            <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
            <param key="host"  value="0.0.0.0"/>
            <param key="port"  value="5445"/>
            <param key="use-nio" value="true"/>


        </acceptor>
        <acceptor name="netty-throughput">
            <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
            <param key="host"  value="0.0.0.0"/>
            <param key="port"  value="5445"/>
            <param key="use-nio" value="true"/>


        </acceptor>
    </acceptors>
    <broadcast-groups>

      <broadcast-group name="bg-group1">

         <group-address>231.7.7.7</group-address>

         <group-port>9876</group-port>

         <broadcast-period>5000</broadcast-period>

         <connector-ref>netty</connector-ref>

      </broadcast-group>

   </broadcast-groups>


   <discovery-groups>

      <discovery-group name="dg-group1">

         <group-address>231.7.7.7</group-address>

         <group-port>9876</group-port>

         <refresh-timeout>10000</refresh-timeout>

      </discovery-group>

   </discovery-groups>

    <cluster-connections>
        <cluster-connection name="test-cluster">
            <address>jms</address>
            <connector-ref>netty</connector-ref>
            <discovery-group-ref discovery-group-name="dg-group1"/>
        </cluster-connection>
    </cluster-connections>
    <address-settings>
        <!--default for catch all-->

        <address-setting match="jms.topic.purchaseOrder">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <max-delivery-attempts>1</max-delivery-attempts>
            <redelivery-delay>200</redelivery-delay>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>

        </address-setting>
        <address-setting match="jms.topic.invoice">
            <dead-letter-address>jms.queue.DLQ</dead-letter-address>
            <max-delivery-attempts>1</max-delivery-attempts>
            <redelivery-delay>200</redelivery-delay>
            <expiry-address>jms.queue.ExpiryQueue</expiry-address>

        </address-setting>

    </address-settings>
    <security-settings>
        <security-setting match="#">
            <permission type="createNonDurableQueue" roles="admin"/>
            <permission type="createDurableQueue" roles="admin"/>
            <permission type="deleteDurableQueue" roles="admin"/>
            <permission type="deleteNonDurableQueue" roles="admin"/>
            <permission type="consume" roles="admin"/>
            <permission type="send" roles="admin"/>
        </security-setting>
    </security-settings>
    <queues>
        <queue name="jms.topic.purchaseOrder">
            <address>jms.topic.purchaseOrder</address>
            <durable>false</durable>
        </queue>
        <queue name="jms.topic.invoice">
            <address>jms.topic.invoice</address>
            <durable>false</durable>
        </queue>
    </queues>



</configuration>

两个实例都启动,但没有迹象表明它们是聚集的,HornetQ文档没有介绍如何测试集群设置。 任何指针都很受欢迎。

0 个答案:

没有答案