You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Avinash <av...@gmail.com> on 2006/12/15 10:28:21 UTC

Exact symantics of creating queues

Hi All,

We have an AMQ Broker [4.2. incubator SNAPSHOT] running as a standalone java
application.

When we are connecting the AMQ Broker and trying to creating queues, we
followed the following scenario.

[1]  Clients connects to AMQ Broker by passing proper credentials.
[2]  After successful connection client will create a queue.

When creating queues various methods are used as follows:
[1]   Create queue by passing the queuename to session object as :
session.createQueue(queuename);
[2]   Create a queue by creating an instance of ActiveMQQueue as :
                 ActiveMQQueue queue = new ActiveMQQueue(queuename);
[3]   Create a queue by creating an instance of ActiveMQQueue and pass it as
an parameter to message producer      
       as :
                MessageProducer producer = session.createProducer(new
ActiveMQQueue(queuename));
[4]   Create a queue by creating an instance of ActiveMQQueue and pass it as
an parameter to message consumer 
       as :
                MessageConsumer consumer = session.createConsumerr(new
ActiveMQQueue(queuename));

While in first three[1,2,3] cases no exception is generated at both the
sides, but the queues are not created. In case [4] when tried to create the
queue by passing an instance of ActiveMQQueue to the consumer, the queues
are getting created at AMQ Broker.

My question is exactly which symantics is required to follow while creating
the queues?

Thanks in advance.

Avinash
      
-- 
View this message in context: http://www.nabble.com/Exact-symantics-of-creating-queues-tf2826002.html#a7888482
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Exact symantics of creating queues

Posted by bhartsb <bh...@cox.net>.
Hi James,

Per the FAQ item you reference, and where it says in the blue box: "Note
that the ActiveMQ Broker will only create server side resources for
destinations when messages are actually sent to them. So you can create as
many instances of ActiveMQTopic and ActiveMQQueue on a client without any
real overhead until you actually send messages to them on a broker. So a JMS
client creating a new ActiveMQQueue POJO does not mean you are creating
server side queue resources." 

James, if this is the case then why does method # 4 below create a queue? 
It seems to be inconsistent behaviour on the part of AMQ.
Further it is my own oppinion that correct semantics is such that "creating"
a queue indeed creates a queue resource on the server.  Sending a msg to a
queue shouldn't create the queue...that is akin to saying sending a letter
"creates the mailbox" or creates the "post office".  It is VERY confusing to
have function/method names that imply  they do something that they aren't
doing.  



James.Strachan wrote:
> 
> See this FAQ entry
> 
> http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html
> 
> On 12/15/06, Avinash <av...@gmail.com> wrote:
>>
>> Hi All,
>>
>> We have an AMQ Broker [4.2. incubator SNAPSHOT] running as a standalone
>> java
>> application.
>>
>> When we are connecting the AMQ Broker and trying to creating queues, we
>> followed the following scenario.
>>
>> [1]  Clients connects to AMQ Broker by passing proper credentials.
>> [2]  After successful connection client will create a queue.
>>
>> When creating queues various methods are used as follows:
>> [1]   Create queue by passing the queuename to session object as :
>> session.createQueue(queuename);
>> [2]   Create a queue by creating an instance of ActiveMQQueue as :
>>                  ActiveMQQueue queue = new ActiveMQQueue(queuename);
>> [3]   Create a queue by creating an instance of ActiveMQQueue and pass it
>> as
>> an parameter to message producer
>>        as :
>>                 MessageProducer producer = session.createProducer(new
>> ActiveMQQueue(queuename));
>> [4]   Create a queue by creating an instance of ActiveMQQueue and pass it
>> as
>> an parameter to message consumer
>>        as :
>>                 MessageConsumer consumer = session.createConsumerr(new
>> ActiveMQQueue(queuename));
>>
>> While in first three[1,2,3] cases no exception is generated at both the
>> sides, but the queues are not created. In case [4] when tried to create
>> the
>> queue by passing an instance of ActiveMQQueue to the consumer, the queues
>> are getting created at AMQ Broker.
>>
>> My question is exactly which symantics is required to follow while
>> creating
>> the queues?
>>
>> Thanks in advance.
>>
>> Avinash
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Exact-symantics-of-creating-queues-tf2826002.html#a7888482
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Exact-symantics-of-creating-queues-tf2826002.html#a7945961
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Exact symantics of creating queues

Posted by James Strachan <ja...@gmail.com>.
See this FAQ entry

http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html

On 12/15/06, Avinash <av...@gmail.com> wrote:
>
> Hi All,
>
> We have an AMQ Broker [4.2. incubator SNAPSHOT] running as a standalone java
> application.
>
> When we are connecting the AMQ Broker and trying to creating queues, we
> followed the following scenario.
>
> [1]  Clients connects to AMQ Broker by passing proper credentials.
> [2]  After successful connection client will create a queue.
>
> When creating queues various methods are used as follows:
> [1]   Create queue by passing the queuename to session object as :
> session.createQueue(queuename);
> [2]   Create a queue by creating an instance of ActiveMQQueue as :
>                  ActiveMQQueue queue = new ActiveMQQueue(queuename);
> [3]   Create a queue by creating an instance of ActiveMQQueue and pass it as
> an parameter to message producer
>        as :
>                 MessageProducer producer = session.createProducer(new
> ActiveMQQueue(queuename));
> [4]   Create a queue by creating an instance of ActiveMQQueue and pass it as
> an parameter to message consumer
>        as :
>                 MessageConsumer consumer = session.createConsumerr(new
> ActiveMQQueue(queuename));
>
> While in first three[1,2,3] cases no exception is generated at both the
> sides, but the queues are not created. In case [4] when tried to create the
> queue by passing an instance of ActiveMQQueue to the consumer, the queues
> are getting created at AMQ Broker.
>
> My question is exactly which symantics is required to follow while creating
> the queues?
>
> Thanks in advance.
>
> Avinash
>
> --
> View this message in context: http://www.nabble.com/Exact-symantics-of-creating-queues-tf2826002.html#a7888482
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/