Monday, December 1, 2014

Running multiple ActiveMQ instances on one machine

1. Download and unzip the ActiveMQ

2. Go to the ActiveMQ home directory and create the instances as follows
./bin/activemq create instanceA
./bin/activemq create instanceB

3. Do ls -l you can see two sub directories created as instanceA and instance B

4. Let instanceA to use the default config, modify the config of instanceB
Go to the instanceB/conf folder and open the file jetty.xml to make the webconsole available at port '8162'

       <property name="connectors">
                <bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
                    <property name="port" value="8162" />

5. Open the activemq.xml file and modify tcp port to '61617'

            <transportConnector name="openwire" uri="tcp://"/>

6. Save the both files and start the instances in two consoles
go to the instanceA/bin folder and ./activemq console
go to the instanceB/bin folder and ./activemq console