Re: delete messages from artemis broker

2017-10-25 Thread Clebert Suconic
You could also remove the files.. use a temporary folder that's used for each test. On Wed, Oct 25, 2017 at 2:03 PM, preben wrote: > Thanks Justin. Will try it out > > > > -- > Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html -- Clebert Suconic

Re: delete messages from artemis broker

2017-10-25 Thread preben
Thanks Justin. Will try it out -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: delete messages from artemis broker

2017-10-25 Thread Justin Bertram
You should be able to use the code I pasted previously (or some approximation thereof) to get the functionality you're looking for. Have you tried that out? Justin On Wed, Oct 25, 2017 at 10:59 AM, preben wrote: > Actually I start and stop the broker between each test, but when running a > se

Re: delete messages from artemis broker

2017-10-25 Thread preben
Actually I start and stop the broker between each test, but when running a series of tests it seems that the newly started broker picks up messages produced in the previous test ? I would have presumed, that it would get a clean broker. To work around this I need the deleteAllMessages. I like the

Re: delete messages from artemis broker

2017-10-25 Thread Justin Bertram
You could do something like this: for (String queueName : broker.getJMSServerManager().getActiveMQServer().getActiveMQServerControl().getQueueNames()) { ((QueueControl)broker.getJMSServerManager().getActiveMQServer().getManagementService().getResource(ResourceNames.QUEUE + queueName)).removeM

Re: delete messages from artemis broker

2017-10-25 Thread Clebert Suconic
You could do it per queue... What we do in our own testsuite.. is to stop the server and start the server on each test.. and use small journal files.. so it starts really fast. There's even artemis-junit, that you could embed in your tests.. and that would do that work for you. Look into our te

delete messages from artemis broker

2017-10-25 Thread preben
Im switching from Activemq to Artemis and have to migrate some unittests I got a activemq baseclass like -> @Before public void startEmbeddedBroker() throws Exception { broker = new BrokerService(); TransportConnector connector = broker.addConnector("tcp://localhost:61616");