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.
Now the pom.xml looks like this
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
then A simple queue broker is there, and by default using the openwire transport and memoryPersistenceAdapter.
TO Change the configuration, we can customize the plugin.
we setup the persistent=true and use 8888 as the openwire port.
Run Again,
if we want to change it to levelDB or more customized setting,
For the producer, you can setup another plugin, here I setup two profile, one for producer and another one is for consumer
the for producer, you can add different settings by passed –D to the command,
to start another consumer , change the prefix , otherwise, they want get any message, since they use the same consumerid
after done, you should see some test results, like
No comments:
Post a Comment