activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kpalania <kpala...@yahoo.com>
Subject Re: Discovering queues programmatically and dequeuing messages off of them
Date Thu, 18 Sep 2008 14:34:07 GMT

Thanks James but this piece of code does not seem to return all the queues on
the broker. Any thoughts on why that would be the case?

-------------------------------------------------------------------------------
  public void testGetAllQueues()
  {
    ActiveMQConnectionFactory connectionFactory = new
ActiveMQConnectionFactory(BROKER_URL);
    Connection connection;
    try
    {
      connection = connectionFactory.createConnection();

      DestinationSource ds = new DestinationSource(connection);
      Set<ActiveMQQueue> queues = ds.getQueues();
      System.out.println("..size: " + queues.size());
      Iterator i = queues.iterator();
      while (i.hasNext())
      {
        Queue q = (Queue) i.next();
        System.out.println("..q: " + q.getQueueName());
      }

      session.close();
      connection.close();
    }
    catch (JMSException e)
    {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

  }

-- 
View this message in context: http://www.nabble.com/Discovering-queues-programmatically-and-dequeuing-messages-off-of-them-tp19538405p19554303.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message