You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Andy Czerwonka <ac...@3esi.com> on 2006/10/11 18:41:49 UTC

Dynamic Topics

I've got a requirement where the Topic that a publisher needs to publish to 
is based on context from a raw message.  Is there a best practice for this 
or am I required to know all of the available topics?  Can I at the very 
least get a list of Topics from the broker and do some kind of pattern 
matching on the message so that the publisher knows which Topics to send to?

The goal here is to have Consumers subscribe to dynamically created Topics 
and have the Producer look into the message and find a Topic that 
corresponds to the message.

-- 
Andy Czerwonka




Re: Dynamic Topics

Posted by James Strachan <ja...@gmail.com>.
On 10/11/06, Andy Czerwonka <ac...@3esi.com> wrote:
>
> "James Strachan" <ja...@gmail.com>
> wrote in message
> news:ec6e67fd0610110958s43e35dbco6fe087717f776ac0@mail.gmail.com...
> > On 10/11/06, Andy Czerwonka <ac...@3esi.com>
> > wrote:
> >> Fantastic - exactly what I need.  Is there a limitation as to how long
> >> the
> >> Topic name can be?
> >
> > I think its currently Short.MAX_VALUE - the only limitation of big
> > topics is RAM. Though the topic name is used as a column in the JDBC
> > persistence - if you are using persistence - so that would limit
> > things further
> >
> Does that mean that there is code that alters table to add columns to the
> database to persist dynamic Topics?

No - its just using a single table column for the topic name
-- 

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

Re: Dynamic Topics

Posted by Andy Czerwonka <ac...@3esi.com>.
"James Strachan" <ja...@gmail.com> 
wrote in message 
news:ec6e67fd0610110958s43e35dbco6fe087717f776ac0@mail.gmail.com...
> On 10/11/06, Andy Czerwonka <ac...@3esi.com> 
> wrote:
>> Fantastic - exactly what I need.  Is there a limitation as to how long 
>> the
>> Topic name can be?
>
> I think its currently Short.MAX_VALUE - the only limitation of big
> topics is RAM. Though the topic name is used as a column in the JDBC
> persistence - if you are using persistence - so that would limit
> things further
>
Does that mean that there is code that alters table to add columns to the 
database to persist dynamic Topics? 




Re: Dynamic Topics

Posted by James Strachan <ja...@gmail.com>.
On 10/11/06, Andy Czerwonka <ac...@3esi.com> wrote:
> Fantastic - exactly what I need.  Is there a limitation as to how long the
> Topic name can be?

I think its currently Short.MAX_VALUE - the only limitation of big
topics is RAM. Though the topic name is used as a column in the JDBC
persistence - if you are using persistence - so that would limit
things further

-- 

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

Re: Dynamic Topics

Posted by Andy Czerwonka <ac...@3esi.com>.
Fantastic - exactly what I need.  Is there a limitation as to how long the 
Topic name can be?

"James Strachan" <ja...@gmail.com> 
wrote in message 
news:ec6e67fd0610110947y5fed577esbab8ecb8ed4e4045@mail.gmail.com...
> On 10/11/06, Andy Czerwonka <ac...@3esi.com> 
> wrote:
>> I've got a requirement where the Topic that a publisher needs to publish 
>> to
>> is based on context from a raw message.  Is there a best practice for 
>> this
>> or am I required to know all of the available topics?
>
> You can create the topic on the fly, its a very lightweight object to 
> create
>
> http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html
>
> in terms of JMS, create a MessageProducer using null as the
> destination, then just pass in the dynamically created Topic object in
> the send() method as a parameter
>
>
>> The goal here is to have Consumers subscribe to dynamically created 
>> Topics
>> and have the Producer look into the message and find a Topic that
>> corresponds to the message.
>
> For consumers you could either create them dynamically or use
> wildcards & selectors
>
> -- 
>
> James
> -------
> http://radio.weblogs.com/0112098/
> 




Re: Dynamic Topics

Posted by James Strachan <ja...@gmail.com>.
On 10/11/06, Andy Czerwonka <ac...@3esi.com> wrote:
> I've got a requirement where the Topic that a publisher needs to publish to
> is based on context from a raw message.  Is there a best practice for this
> or am I required to know all of the available topics?

You can create the topic on the fly, its a very lightweight object to create

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

in terms of JMS, create a MessageProducer using null as the
destination, then just pass in the dynamically created Topic object in
the send() method as a parameter


> The goal here is to have Consumers subscribe to dynamically created Topics
> and have the Producer look into the message and find a Topic that
> corresponds to the message.

For consumers you could either create them dynamically or use
wildcards & selectors

-- 

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