activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene <eugen.ra...@gmail.com>
Subject Re: ActiveMQ Admin or commandline-jmx to configure memoryLimit at run time
Date Mon, 21 Nov 2011 14:53:56 GMT
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.

Mime
View raw message