How to delete all of the topics in ActiveMQ?
Asked Answered
C

2

7

I'm using ActiveMQ with the C# client library. I created 10,000 topics with random names as part of a test for evaluation purposes and now I can't get rid of the topics. ActiveMQ grinds to a halt with this number of topics so I need them out of the system. Here is what I have tried so far, and none of it has worked. I'm running ActiveMQ as a Windows service.

  • Delete all of the files and folders in ACTIVEMQ_HOME\Data
  • Turn off all persistence
  • Delete all of the files and folders in the persistence folder
  • Delete the entire ACTIVEMQ_HOME directory and reinstall it in a different folder

I've traced the file activity and cannot find any file that is written to when a topic is created or deleted.

I realize that the .NET client library is a little light on functionality, so I can't even get a list of all the topics programmatically.

Carmella answered 2/3, 2009 at 18:59 Comment(0)
F
21

Go to your broker configuration file, open the file for editing on the broker element, add the following attribute:

deleteAllMessagesOnStartup="true"

This will cause all previous topics & queues, and their pending messages to be deleted from your kaha store when you restart your broker.

Have Fun!

Farmstead answered 13/4, 2009 at 21:34 Comment(3)
@Farmstead where will I find configuration file.Ingeborg
@Farmstead I found it.and tried it's working great. If you know is there any tutorial for this type of tips. suggest me.Ingeborg
How should I do this in version >5.10Despondent
G
2

This question might be old, but a quick and easy way to totally purge all data in ActiveMQ alongwith all queues and topics is to go to the following path:

<ActiveMQ_Installation_Directory>/data

And delete all files in that.

Now once you restart AMQ it will start as a fresh, clean install.

Gigantism answered 29/7, 2019 at 11:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.