On Jan 7, 2009, at 12:20 PM, James Adams wrote:


When I start an embedded ActiveMQ broker it is a fresh/clean/empty queue,
right?

I haven't used the embedded broker much but I think this is wrong. AFAIK unless you configure a broker to use the MemoryPersistenceAdapter it will use some kind of file system or database storage for all persistent messages, so, as per spec, they will survive a server shutdown.

You might be able to find and remove the data files between runs.... although with e.g. junit creating all the tests before running any of them this might cause problems. You might also be able to configure each test to use a different directory. Or find a way to use the MemoryPersistenceAdapter. Unfortunately I don't know how to do any of these things.

thanks
david jencks

 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.


Reply via email to