You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by taubler <da...@yahoo.com> on 2007/12/04 22:53:47 UTC

Removing a queue

Hi,

I'm looking for a way to programmatically remove a queue from a broker once
I'm done using it (e.g. during tearDown() in a JUnit test; I can't manually
go into the JMX console to delete the queue by hand). I've seen a lot of
tips to this effect:

via Java code or JMX you can grab the BrokerViewMBean and call one of the
following methods

    * removeQueue(String)
    * removeTopic(String)

But the problem is, I have no reference to the BrokerViewMBean, and I
haven't a clue as to how to obtian one. Can anyone advise me as to how?

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Removing-a-queue-tf4945906s2354.html#a14160194
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Removing a queue

Posted by Jonas Lim <jl...@exist.com>.
Hi,

You may want to check out some of the unit tests for jmx for examples on 
obtaining references to activemq mbeans

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/

Regards,
Jonas

taubler wrote:
> Hi,
>
> I'm looking for a way to programmatically remove a queue from a broker once
> I'm done using it (e.g. during tearDown() in a JUnit test; I can't manually
> go into the JMX console to delete the queue by hand). I've seen a lot of
> tips to this effect:
>
> via Java code or JMX you can grab the BrokerViewMBean and call one of the
> following methods
>
>     * removeQueue(String)
>     * removeTopic(String)
>
> But the problem is, I have no reference to the BrokerViewMBean, and I
> haven't a clue as to how to obtian one. Can anyone advise me as to how?
>
> Thanks in advance.
>