activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raffaele <r.gambe...@prismasw.it>
Subject Re: how find a queue?
Date Wed, 06 Jun 2007 08:42:08 GMT

I'm making a sort of wrapping of some of the main classes of ActiveMQ, in
detail i have:
- JMSWorker 

- QueueWorker extends JMSWorker
- TopicWorker extends JMSWorker

- QueueBrowser extends QueueWorker
- QueueConsumer extends QueueWorker
- QueueProducer extends QueueWorker

- TopicConsumer extends TopicWorker
- TopicPublisher extends TopicWorker

This wrapping permits me to abstract my code from the JMS implementation, in
fact till now I used Oracle JMS implementation and so, passing from Oracle
to ActiveMQ should be as trasparent as possible using the above wrapper
classes.

Because of the constructor of QueueWorker is this:
public QueueWorker(String url, String queueName) throws JMSException {...}
and because QueueBrowser extends QueueWorker, I prefer having just the
queueName, then find that Queue and then I could instanciate a QueueBrowser.

I hope it's clear.

Thanks for the FAQ link in the other reply, I have understanded that I can
use createQueue without problems.

Best regards




jlim wrote:
> 
> Hi Raffaele,
> Just out of curiosity , what would you be doing with the Queue object?   
> If you already know the name of an existing queue then you can just use 
> Session.createQueue (or do a jndi lookup)  to get the queue object and  
> use it to create a |MessageConsumer| or a |MessageProducer| to 
> receive/send message  from/to that  queue.
> 
> Regards,
> Jonas
> 
> 
> 
> Raffaele wrote:
>> Hi,
>>
>> the createQueue method is implemented in this way:
>> public Queue createQueue(String queueName) throws JMSException {
>>          checkClosed();
>>          return new ActiveMQQueue(queueName);
>>      }
>>
>> And so, a new Object is created....Going deeper in the code I have seen
>> no
>> mechanism about retrieving already existing Queue based on its name.
>> Perhaps
>> am I wrong?
>>
>> Best regards,
>>
>> Raffaele
>>
>>
>> jlim wrote:
>>   
>>> Hi,
>>>
>>> If you just want to get the handle of a queue object based on its name I 
>>> think you can use  the Session.createQueue(String queueName)  method.
>>>
>>> Regards,
>>> jonas
>>>
>>> *
>>> *
>>>
>>>
>>>
>>> Raffaele wrote:
>>>     
>>>> Hi all,
>>>>
>>>> I'm looking for a method to retrieve a specific queue based on its
>>>> name,
>>>> that is a method that returns a Queue object.
>>>>
>>>> In Oracle JMS implementation there is such a method, here it is:
>>>> http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b12023/oracle/jms/AQjmsSession.html#getQueue(java.lang.String,%20java.lang.String)
>>>>
>>>> In ActiveMQ does it exist analogous method?
>>>>
>>>> Best regards and thanks,
>>>>
>>>> Raffaele
>>>>   
>>>>       
>>>     
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/how-find-a-queue--tf3872540s2354.html#a10984660
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message