How do I disable persistence
There are three main ways to disable persistence, such as for unit testing JMS code
- Set the NON_PERSISTENT message delivery flag on your MessageProducer
- Set the
persistent=falseflag in the
<broker/>element of the Xml Configuration or on the property BrokerService
- 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.