1. 程式人生 > >ActiveMQ部署多例項

ActiveMQ部署多例項

1、複製兩份一樣的apache-activemq-5.9.1,如下

2、修改apache-activemq-5.9.1-file的配置檔案\conf\activemq.xml,修改點如下

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost-file" dataDirectory="${activemq.data}">

brokerName要不與原來的衝突

<transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>
<transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61617?maximumConnections=10000&amp;wireFormat.maxFrameSize=1048576000&amp;"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5673?maximumConnections=10000&amp;wireFormat.maxFrameSize=1048576000&amp;"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61618?maximumConnections=10000&amp;wireFormat.maxFrameSize=1048576000&amp;"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1884?maximumConnections=10000&amp;wireFormat.maxFrameSize=1048576000&amp;"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61619?maximumConnections=10000&amp;wireFormat.maxFrameSize=1048576000&amp;"/>
        </transportConnectors>

transportConnector的埠要不與原來的衝突

3、修改apache-activemq-5.9.1-file的配置檔案\conf\jetty.xml,修改點如下

<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
             <!-- the default port number for the web console -->
        <property name="port" value="8161"/>
    </bean>
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
             <!-- the default port number for the web console -->
        <property name="port" value="8162"/>
    </bean>

jettyPort的埠要不與原來的衝突

4、如果使用了jmx,需要修改apache-activemq-5.9.1-file的配置檔案\conf\activemq.xml,修改點如下

<managementContext>
            <managementContext createConnector="true" connectorPort="11099"/>
        </managementContext>

connectorPort的埠要不與原來的衝突,詳見http://activemq.apache.org/jmx.html