activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChicagoBob123 <b...@bobfx.com>
Subject Deleteing or purging a Queue
Date Fri, 08 Oct 2010 15:36:13 GMT

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.

Mime
View raw message