You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mrdiesel <mr...@gmail.com> on 2011/11/19 01:22:36 UTC

ActiveMQ Admin or commandline-jmx to configure memoryLimit at run time

Hello,

I m trying to configure memory limit at run time to be able to throttle my
producers.

Using jconsole and jmx I m able to change *MemoryLimit* (which is
highlighted in blue) and throttle the producers.

But i want to be able to do this at run time, without having to restart the
server.

I tried using commandline-jmxclient-0.10.3 which is the only version of it i
could find online :( very old. and no luck.

I tried using activemq-admin and not sure how to get around that to set a
value. I m aware that changes wont persist to config file.

How can i do it?

this is how i can query with commandline tool

java -jar cmdline-jmxclient-0.10.3.jar - localhost:1099
org.apache.activemq:BrokerName=defaultBroker,Destination=Testing,Type=Queue
EnqueueCount
11/18/2011 10:33:08 -0800 org.archive.jmx.Client EnqueueCount: 999

but i want to be able to set the *MemoryLimit*. 

can someone advise please?

Thanks.



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Admin-or-commandline-jmx-to-configure-memoryLimit-at-run-time-tp4085287p4085287.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ Admin or commandline-jmx to configure memoryLimit at run time

Posted by Eugene <eu...@gmail.com>.
I might be wrong, but just trying.
How about if you start your own broker instance through

BrokerService broker = new BrokerService();
broker.setBrokerName("fast");
broker.getSystemUsage().getMemoryUsage().setLimit(64*1024*1024);
PolicyEntry policy = new PolicyEntry();
policy.setMemoryLimit(4 * 1024 *1024); // 4 * 1024 *1024 -> replace with a
variable
policy.setProducerFlowControl(false);
PolicyMap pMap = new PolicyMap();
pMap.setDefaultEntry(policy);
broker.setDestinationPolicy(pMap);
broker.addConnector("tcp://localhost:61616");
broker.start();

and expose the variable with JMX.

Using Spring and MBeanServer should be pretty easy - not sure if it will
work. :)

Cheers,
Eugene. 

--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Admin-or-commandline-jmx-to-configure-memoryLimit-at-run-time-tp4085287p4091755.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.