activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Lim <j...@exist.com>
Subject Re: AMQ 5.1 - How to get a list of Queues
Date Thu, 08 May 2008 09:51:29 GMT
Hi Shaf,

Just tested this on 5.1.0 and seems to work fine on my test.   I tested 
this using startup destinations 
(http://activemq.apache.org/configure-startup-destinations.html) and 
also creating one via jmx.

Can you look in jconsole (or any jmx console) to see if the queues are 
actually created?

Regards,
Jonas

shaf wrote:
> Hello,
>
> I am trying to get a list of existing Queues with the following code:
>
> 	ActiveMQConnectionFactory connectionFactory = new
> ActiveMQConnectionFactory( server );
> 	ActiveMQConnection amqcon = connectionFactory.createConnection();
> 	Set<ActiveMQQueue> amqs = amqcon.getDestinationSource().getQueues();
> 	Iterator<ActiveMQQueue> queues = amqs.iterator();
> 		
> 	while ( queues.hasNext() )
> 	{
> 		ActiveMQQueue queue = queues.next();
> 		System.out.println( "Queue: " + queue.getPhysicalName() );
> 	}
>
> The code above does not work consistently. I have a sample queue as well as
> one that I created using the admin interface and none show up. Can someone
> provide some guidance here please.
>
> Thanks,
> Shaf.
>   

Mime
View raw message