activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaf <shaffin.bha...@gmail.com>
Subject Re: AMQ 5.1 - How to get a list of Queues
Date Thu, 08 May 2008 14:14:41 GMT

Thanks guys, so when I try to create a Queue using the following:

	ActiveMQSession session = this.con.getConnection().createSession(false,
Session.AUTO_ACKNOWLEDGE);
	// create queue
	Queue request = session.createQueue( name );
	System.out.println("The queue has been created: " + request.getQueueName()
);
	Thread.sleep( 3000 );

An then I try to list the queues in the previous code snippet, it does not
show up. When I try using the admin console, I still dont see the queue that
I created! Is there something wrong or is this a bug??

-Shaf.



James.Strachan wrote:
> 
> BTW you can listen to destinations being added/removed by calling the
> setDestinationListener method on the DestinationSource
> 
> 
> 
> 2008/5/8 shaf <shaffin.bhanji@gmail.com>:
>>
>>  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.
>>  --
>>  View this message in context:
>> http://www.nabble.com/AMQ-5.1---How-to-get-a-list-of-Queues-tp17117156s2354p17117156.html
>>  Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/AMQ-5.1---How-to-get-a-list-of-Queues-tp17117156s2354p17126489.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message