activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Santillan <>
Subject StatisticsBrokerPlugin activation
Date Thu, 16 Sep 2010 08:24:17 GMT

I am using activemq as a dependency in a web app. My web app is deployed 
to a jetty server which is run through maven by issuing "mvn jetty:run".

Of course, one part of the web app is to create and start a broker. I am 
doing this through ActiveMQConnectionFactory (as described at the last 
part of, 
titled "Using ActiveMQConnectionFactory"):

String brokerURI = "vm://testBroker?broker.persistent=false";
ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory(brokerURI);
Connection connection = cf.createConnection();

Now, since I am running my web web app through maven, and activemq is 
used as a library (not as a standalone app), I don't have an 
activemq.xml configuration file. So, I don't know where to 
activate/enable StatisticsBrokerPlugin as described at

<broker ...>

Also, since I am using ActiveMQConnectionFactory to create and start the 
broker, I can't take advantage of setting the plugin through BrokerService:

BrokerPlugin plugin = new StatisticsBrokerPlugin();
BrokerPlugin[] plugins = {plugin};

BrokerService broker = new BrokerService();
try {
} catch (Exception e) {

Now, my questions are:
1. How will I be able to set the StatisticsBrokerPlugin with the above 
2. Is there a way to get a reference to the broker to be able to set the 
3. Is there a way to add and use activemq.xml if it is used as a library 
and run through maven? Set in pom.xml?

Please help. I really need this to work.

Thanks in advance.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message