I'd start() the connection first - then wait a few seconds; the
advisories are asynchronously sent once a connection starts

2008/9/18 kpalania <[EMAIL PROTECTED]>:
>
> 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.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to