An embedded broker is no different from an non embedded broker. By default it will use a message store for any persistent messages. If you want a broker to always start with an empty store there is a deleteAllMessagesOnStartup attribute on BrokerService that will clear out the store for you. Alternatively you could set the persistent attribute to false and a memory store (will will not persist any messages to disk) will be used. Persistent messages are the default for a standard JMS client.
2009/1/7 James Adams <[email protected]>: > > When I start an embedded ActiveMQ broker it is a fresh/clean/empty queue, > right? My understanding was that there is no possibility of messages > building up from previous test runs or other message senders adding messages > to a queue which will be present the next time the embedded ActiveMQ broker > comes up. The reason I ask is that I assume that the above is the case, and > my tests are expecting an empty queue each time they run, and I sometimes > see messages in the queue which shouldn't be in the queue as a result of my > test run, so I thought maybe they're leftovers from a previous test run. > Can someone confirm that I am not mistaken about how the embedded broker > starts, so I can know that messages I read from my queue in a test are in > fact only messages which could have been sent as a result of my test (which > starts the embedded broker using Spring) and not leftovers from previous > runs. > > Thanks in advance for any comments. > > --James > -- > View this message in context: > http://www.nabble.com/Embedded-broker-is-always-empty-%28no-messages%29-each-time-it%27s-started--tp21339447p21339447.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source SOA http://FUSESource.com
