ActiveMQ-以编程方式删除队列 [英] ActiveMQ - Removing queues programmatically
问题描述
研究员StackOverflowers,有没有办法让我以编程方式在ActiveMQ中删除队列或主题?我使用的是ActiveMQ的标准持久性,我的应用程序要求在启动时动态重新创建所有新队列(除非队列中存储了消息,在这种情况下,该队列应保持存在).
Fellow StackOverflowers, is there a way for me to remove a queue or a topic in ActiveMQ programmatically? I am using ActiveMQ's standard persistency, and my application requires that, on startup, all new queues be dynamically re-created (unless there are messages stored in the queue, in which case, the queue should remain to exist).
我还在通过会话以编程方式创建所有队列.是否有等效于该过程的步骤,只是删除队列?查询和遍历现有队列也将很有用,但是我还没有找到一种方法.
I am also creating all queues programmatically through sessions. Is there an equivalent to that procedure, only to delete a queue? Querying and iterating through the existing queues would also be useful, but i haven't found a way to do that yet.
推荐答案
您还可以删除在一段时间内处于非活动状态的目的地.自Active MQ 5.4起可用
You can also Delete Destinations that are inactive for some period of time. Available since Active MQ 5.4
或者,如果您正在运行ActiveMQ Embedded,则可以使用API删除目标:
Alternatively if you are running ActiveMQ embedded you can use the API to remove destinations: Region.removeDestination
这篇关于ActiveMQ-以编程方式删除队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!