Friday, April 25, 2014

How To: Test Activemq 5.9.1 Master/Slave by replicatedLevelDB/Zookeeper

Start from 5.9, Activemq comes with another HA option called ReplicatedLevelDB. I would recommend start from 5.9.1 at least, and I found a lot bugs in the 5.9.
  basic idea, Zookeeper as the central coordination point, every broker talked to the Zk , ZK wills tell the member information like who is the master. slave talks to master node to fetch the incremental change when it come online.
 
for the configuration, each member in a cluster share the same broker name, zookeepeer address, and zkPass.

image

and transportconnector is transparent to the underlining persistence layer.

image

when you startup the broker, for the 1st one, since we setup the replica to 2,that means we have to start at least 2 brokers to meet the quota requirement.
 image

after 2 broker ready, you can see it’s a slave node,
image

for the 1st ndoe, which is the master node, will turn on the transportconnector that is openwire here,
image

3rd one will be a slave node too.
image

Thursday, April 24, 2014

How To: test Activemq using Maven plugins

ActiveMQ has two useful Maven plugins which enable you to test different Activemq deployment layout and Performace (Producer/Consumer) quickly. the plugins have been renamed since 5.7, and this demo is based on latest version 5.9.

Demo: Setup one standard broker quickly.

Create one maven eclipse project, and add the plugin dependency called activemq-maven-plugin to the POM file.
image

Now the pom.xml looks like this

image

for this plugin , we will add configuration later on this plugin, like the Activem.xml config, etc.
now by default, we can run the plugin on the command

image

then A simple queue broker is there, and by default using the openwire transport and memoryPersistenceAdapter.

image

TO Change the configuration, we can customize the plugin.
we setup the persistent=true and use 8888 as the openwire port.
image

Run Again,
image

if we want to change it to levelDB or more customized setting,
image

 

For the producer, you can setup another plugin, here I setup two profile, one for producer and another one is for consumer

image

the for producer, you can add different settings by passed –D to the command,
image

and consumer,
image

to start another consumer , change the prefix , otherwise, they want get any message, since they use the same consumerid

image

after done, you should see some test results, like

image

 
Locations of visitors to this page