Running Multiple ActiveMQ Instances on One Machine
Join the DZone community and get the full member experience.
Join For Freea few weeks ago i started making use of apache activemq again as the jms provider with my mule esb solution. since it had been a few years that i used activemq i thought it would be nice to check out some of the (new) features like the failover transport and other clustering features . to be able to test these last things i needed multiple installations of activemq on my machine. luckily this isn’t very hard to accomplish, although the documentation on this on the activemq site is quite minimal.
the first step is to download and unzip the activemq package, which i did at ~/develop/apache-activemq-5.8.0.
to create the instances i go to the activemq home directory and use the ‘create’ command like this:
cd develop/apache-activemq-5.8.0/ ./bin/activemq create instancea ./bin/activemq create instanceb
now if you do a ‘ls -l’ you will see that there are two subdirectories created, ‘instancea’ and ‘instanceb’. since both instances will make use of the default ports we have to modify the config for the second instance. go to the directory ‘develop/apache-activemq-5.8.0/instanceb/conf’ and open the file ‘jetty.xml’ to make the webconsole available at port ’8162′ by modifying the following line:
<bean id="connector" class="org.eclipse.jetty.server.nio.selectchannelconnector"> <property name="port" value="8162" /> </bean>
next open the file ‘activemq.xml’ in the same directory and modify the following part:
<transportconnectors> <!-- dos protection, limit concurrent connections to 1000 and frame size to 100mb --> <transportconnector name="openwire" uri="tcp://0.0.0.0:61617?maximumconnections=1000&wireformat.maxframesize=104857600"/> <transportconnector name="amqp" uri="amqp://0.0.0.0:5673?maximumconnections=1000&wireformat.maxframesize=104857600"/> </transportconnectors>
that’s it! make sure both files are saved and start the first instance with:
cd ~/develop/apache-activemq-5.8.0/instancea/bin ./instancea console
open up a new console and run the commands:
cd /users/pascal/develop/apache-activemq-5.8.0/instanceb/bin ./instanceb console
now you have two instances running next to each other and can start testing the ‘advanced’ functions of activemq.
Published at DZone with permission of $$anonymous$$. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments