There are three main ways to disable persistence, such as for unit testing JMS code

  1. Set the NON_PERSISTENT message delivery flag on your MessageProducer
  2. Set the persistent=false flag in the <broker/> element of the Xml Configuration or on the property BrokerService
  3. Delete the persistence files before running your tests (a bit hacky)

If you are unit testing you may be interested in How To Unit Test JMS Code.

Please refer to the Initial Configuration guide on how to disable persistence via system properties, java code or using the Xml Configuration

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram