| <div class="wiki-content maincontent"><p>There are three main ways to disable persistence, such as for unit testing JMS code</p> |
| |
| <ol><li>Set the NON_PERSISTENT message delivery flag on your MessageProducer</li><li>Set the <strong>persistent=false</strong> flag in the <strong><broker/></strong> element of the <link><page ri:content-title="Xml Configuration"></page></link> or on the property <a shape="rect" href="http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/broker/BrokerService.html">BrokerService</a></li><li>Delete the persistence files before running your tests (a bit hacky)</li></ol> |
| |
| |
| <p>If you are unit testing you may be interested in <link><page ri:content-title="How To Unit Test JMS Code"></page></link>.</p> |
| |
| <p>Please refer to the <link><page ri:content-title="Initial Configuration"></page></link> guide on how to disable persistence via system properties, java code or using the <link><page ri:content-title="Xml Configuration"></page></link></p></div> |
| |