I have the need to purge a queue when a new request comes in on a queue I
named
commandqueue.
When I try to delete the queue I get an exception that there still is a
consumer
attached to the queue. That may be true and is of no consequenece to me. I
need to
either purge or delete the queue.
Is there a way I can do this?
I am using NMS and here is my delete code.
public void DeleteQueue(String Quename)
{
if (QueueSession == null || connection == null)
Connect();
bool foundq = false;
// delete the queue to remove it. Then recreate it.
try{
IQueue iq = QueueSession.GetQueue(Quename);
if(iq != null)
{
if(iq.IsQueue)
foundq = true;
}
}
catch(Exception )
{
return;
}
if(foundq)
QueueSession.DeleteQueue(Quename);
}
--
View this message in context: http://activemq.2283324.n4.nabble.com/Deleteing-or-purging-a-Queue-tp2968555p2968555.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
|