You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by eldictson <el...@yahoo.com> on 2007/10/10 23:08:09 UTC

createTopic & createQueue behavior different than JMS API

Was wondering the Session createTopic() & createQueue() methods dynamically
creates physical topics and queues in the ActiveMQ broker when the JMS API
docs specify the following:

createTopic
public Topic createTopic(java.lang.String topicName)
                  throws JMSException

Creates a topic identity given a Topic name. 
This facility is provided for the rare cases where clients need to
dynamically manipulate topic identity. This allows the creation of a topic
identity with a provider-specific name. Clients that depend on this ability
are not portable. 

Note that this method is not for creating the physical topic. The physical
creation of topics is an administrative task and is not to be initiated by
the JMS API. The one exception is the creation of temporary topics, which is
accomplished with the createTemporaryTopic method.

Thanks
-- 
View this message in context: http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13144881
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: createTopic & createQueue behavior different than JMS

Posted by James Strachan <ja...@gmail.com>.
On 11/10/2007, eldictson <el...@yahoo.com> wrote:
>
> Interesting...seems odd that you would be able to send a message to a
> destination that doesn't already exist.

Its a usabiilty feature. Anyone who's used RV and MQSeries with a
sysadmin to create new destinations will probably like this feature.

If you want to disable this feature, just use security so that only
admins can create new topics/queues so that clients can't generate new
destinations on the fly

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

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

Re: createTopic & createQueue behavior different than JMS A

Posted by eldictson <el...@yahoo.com>.
Interesting...seems odd that you would be able to send a message to a
destination that doesn't already exist.  Anyway, I see now how it works and
that it "technically" follows the API and I agree the first paragraph of the
createTopic() and createQueue() API description is fuzzy.

Thanks!


Hiram Chirino wrote:
> 
> On 10/10/07, eldictson <el...@yahoo.com> wrote:
>>
>> It seems as though ActiveMQ implements these method calls differently
>> from
>> the JMS API.  Reading the API description I get the impression that, when
>> using createTopic() or createQueue(),  the topics and queues should not
>> actually be physically created for other JMS users to see but rather to
>> create a topic object from a topic that has already been administratively
>> created in the broker.  The way ActiveMQ implements the calls however, is
> 
> Well the actually API description is a bit fuzzy.  But generally your
> description is what most providers do.
> 
> ActiveMQ implements it this way too. Notice that if you client does a
> createQueue() but never sends a message to that queue, the queue is
> NOT physically created.
> 
>> that a topic actually gets created for other JMS users to see and pub/sub
>> to.  It seems as though ActiveMQ implements these methods the way the API
>> describes the createTemporaryTopic() should be implemented.  Am I not
>> undertanding something here?
>>
> 
> What ActiveMQ does is create destinations on demand by default.  So
> when a message is sent to a non-existent destination, it auto-creates
> the destination.  But it only gets created if the user has permission
> to create the destination... which in the default configuration all
> users can create any destination.
> 
> Make more sense?
> 
>>
>> Hiram Chirino wrote:
>> >
>> > So what's the question?
>> >
>> > On 10/10/07, eldictson <el...@yahoo.com> wrote:
>> >>
>> >> Was wondering the Session createTopic() & createQueue() methods
>> >> dynamically
>> >> creates physical topics and queues in the ActiveMQ broker when the JMS
>> >> API
>> >> docs specify the following:
>> >>
>> >> createTopic
>> >> public Topic createTopic(java.lang.String topicName)
>> >>                   throws JMSException
>> >>
>> >> Creates a topic identity given a Topic name.
>> >> This facility is provided for the rare cases where clients need to
>> >> dynamically manipulate topic identity. This allows the creation of a
>> >> topic
>> >> identity with a provider-specific name. Clients that depend on this
>> >> ability
>> >> are not portable.
>> >>
>> >> Note that this method is not for creating the physical topic. The
>> >> physical
>> >> creation of topics is an administrative task and is not to be
>> initiated
>> >> by
>> >> the JMS API. The one exception is the creation of temporary topics,
>> which
>> >> is
>> >> accomplished with the createTemporaryTopic method.
>> >>
>> >> Thanks
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13144881
>> >> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Regards,
>> > Hiram
>> >
>> > Blog: http://hiramchirino.com
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13147299
>> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards,
> Hiram
> 
> Blog: http://hiramchirino.com
> 
> 

-- 
View this message in context: http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13149567
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: createTopic & createQueue behavior different than JMS A

Posted by Hiram Chirino <hi...@hiramchirino.com>.
On 10/10/07, eldictson <el...@yahoo.com> wrote:
>
> It seems as though ActiveMQ implements these method calls differently from
> the JMS API.  Reading the API description I get the impression that, when
> using createTopic() or createQueue(),  the topics and queues should not
> actually be physically created for other JMS users to see but rather to
> create a topic object from a topic that has already been administratively
> created in the broker.  The way ActiveMQ implements the calls however, is

Well the actually API description is a bit fuzzy.  But generally your
description is what most providers do.

ActiveMQ implements it this way too. Notice that if you client does a
createQueue() but never sends a message to that queue, the queue is
NOT physically created.

> that a topic actually gets created for other JMS users to see and pub/sub
> to.  It seems as though ActiveMQ implements these methods the way the API
> describes the createTemporaryTopic() should be implemented.  Am I not
> undertanding something here?
>

What ActiveMQ does is create destinations on demand by default.  So
when a message is sent to a non-existent destination, it auto-creates
the destination.  But it only gets created if the user has permission
to create the destination... which in the default configuration all
users can create any destination.

Make more sense?

>
> Hiram Chirino wrote:
> >
> > So what's the question?
> >
> > On 10/10/07, eldictson <el...@yahoo.com> wrote:
> >>
> >> Was wondering the Session createTopic() & createQueue() methods
> >> dynamically
> >> creates physical topics and queues in the ActiveMQ broker when the JMS
> >> API
> >> docs specify the following:
> >>
> >> createTopic
> >> public Topic createTopic(java.lang.String topicName)
> >>                   throws JMSException
> >>
> >> Creates a topic identity given a Topic name.
> >> This facility is provided for the rare cases where clients need to
> >> dynamically manipulate topic identity. This allows the creation of a
> >> topic
> >> identity with a provider-specific name. Clients that depend on this
> >> ability
> >> are not portable.
> >>
> >> Note that this method is not for creating the physical topic. The
> >> physical
> >> creation of topics is an administrative task and is not to be initiated
> >> by
> >> the JMS API. The one exception is the creation of temporary topics, which
> >> is
> >> accomplished with the createTemporaryTopic method.
> >>
> >> Thanks
> >> --
> >> View this message in context:
> >> http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13144881
> >> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Regards,
> > Hiram
> >
> > Blog: http://hiramchirino.com
> >
> >
>
> --
> View this message in context: http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13147299
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: createTopic & createQueue behavior different than JMS AP

Posted by eldictson <el...@yahoo.com>.
It seems as though ActiveMQ implements these method calls differently from
the JMS API.  Reading the API description I get the impression that, when
using createTopic() or createQueue(),  the topics and queues should not
actually be physically created for other JMS users to see but rather to
create a topic object from a topic that has already been administratively
created in the broker.  The way ActiveMQ implements the calls however, is
that a topic actually gets created for other JMS users to see and pub/sub
to.  It seems as though ActiveMQ implements these methods the way the API
describes the createTemporaryTopic() should be implemented.  Am I not
undertanding something here?


Hiram Chirino wrote:
> 
> So what's the question?
> 
> On 10/10/07, eldictson <el...@yahoo.com> wrote:
>>
>> Was wondering the Session createTopic() & createQueue() methods
>> dynamically
>> creates physical topics and queues in the ActiveMQ broker when the JMS
>> API
>> docs specify the following:
>>
>> createTopic
>> public Topic createTopic(java.lang.String topicName)
>>                   throws JMSException
>>
>> Creates a topic identity given a Topic name.
>> This facility is provided for the rare cases where clients need to
>> dynamically manipulate topic identity. This allows the creation of a
>> topic
>> identity with a provider-specific name. Clients that depend on this
>> ability
>> are not portable.
>>
>> Note that this method is not for creating the physical topic. The
>> physical
>> creation of topics is an administrative task and is not to be initiated
>> by
>> the JMS API. The one exception is the creation of temporary topics, which
>> is
>> accomplished with the createTemporaryTopic method.
>>
>> Thanks
>> --
>> View this message in context:
>> http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13144881
>> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards,
> Hiram
> 
> Blog: http://hiramchirino.com
> 
> 

-- 
View this message in context: http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13147299
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: createTopic & createQueue behavior different than JMS AP

Posted by Hiram Chirino <hi...@hiramchirino.com>.
So what's the question?

On 10/10/07, eldictson <el...@yahoo.com> wrote:
>
> Was wondering the Session createTopic() & createQueue() methods dynamically
> creates physical topics and queues in the ActiveMQ broker when the JMS API
> docs specify the following:
>
> createTopic
> public Topic createTopic(java.lang.String topicName)
>                   throws JMSException
>
> Creates a topic identity given a Topic name.
> This facility is provided for the rare cases where clients need to
> dynamically manipulate topic identity. This allows the creation of a topic
> identity with a provider-specific name. Clients that depend on this ability
> are not portable.
>
> Note that this method is not for creating the physical topic. The physical
> creation of topics is an administrative task and is not to be initiated by
> the JMS API. The one exception is the creation of temporary topics, which is
> accomplished with the createTemporaryTopic method.
>
> Thanks
> --
> View this message in context: http://www.nabble.com/createTopic---createQueue-behavior-different-than-JMS-API-tf4603635s2354.html#a13144881
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com