the unit tests are full of programmatic usage, have a peek at the various packages in the source:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ On 9 February 2011 03:29, Jim Newsham <[email protected]> wrote: > > We're creating an embedded broker service programmatically. I want to add > in memory/temp usage limits, but don't really have the time to test the > behavior of the broker to see if the settings are working. Would appreciate > if someone in the know could have a quick look at this and let me know if > it'll work. > > brokerService = new BrokerService(); > brokerService.setBrokerName(BROKER_NAME); > brokerService.setUseJmx(ENABLE_BROKER_JMX); > brokerService.setUseShutdownHook(false); > brokerService.setSchedulerSupport(false); > brokerService.setPersistent(false); > > // these are the new lines I'm adding; as you can see from above, we don't > want/need persistence > SystemUsage systemUsage = brokerService.getSystemUsage(); > systemUsage.getMemoryUsage().setLimit(MEMORY_STORE_USAGE_LIMIT); > systemUsage.getTempUsage().setLimit(TEMP_STORE_USAGE_LIMIT); > > P.S. Where do the temp files go? Are these cleaned up anywhere? > > Thanks! > Jim > > P.P.S. I would love to see more documentation on the ActiveMQ site > regarding programmatic usage of the brokers. > -- http://blog.garytully.com http://fusesource.com
