You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Thomas Swindells <ts...@ndsuk.com> on 2006/06/19 10:22:11 UTC

Creating destinations

Is there any way to create a generic destination from a String and have
ActiveMQ automatically create the correct Topic/Queue version?

That is if the destination name was "topic://name" then a topic destination
would be created and if it were "queue://name" then a queue destination
would be created?
--
View this message in context: http://www.nabble.com/Creating-destinations-t1809909.html#a4932438
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Creating destinations

Posted by James Strachan <ja...@gmail.com>.
On 6/19/06, Thomas Swindells <ts...@ndsuk.com> wrote:
>
> I guess that's a no then, unless I'm missing something the only option is to
> manually strip off the topic:// or queue:// and then progmatically pick the
> right call to make?

Ah sorry I misread your question.

If you want to take a String and turn it into a queue/topic object
then you can use this method...

http://incubator.apache.org/activemq/maven/activemq-core/apidocs/org/apache/activemq/command/ActiveMQDestination.html#createDestination(java.lang.String,%20byte)

e.g.

Destination dest = ActiveMQDestination.create("topic://foo.bar",
ActiveMQDestination.QUEUE);

the second parameter is used to choose whats the default type of a
destination if it doesn't have the queue/topic prefix.


>
> Thomas
>
> James.Strachan wrote:
> >
> > http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html
> >
> > On 6/19/06, Thomas Swindells <ts...@ndsuk.com> wrote:
> >>
> >> Is there any way to create a generic destination from a String and have
> >> ActiveMQ automatically create the correct Topic/Queue version?
> >>
> >> That is if the destination name was "topic://name" then a topic
> >> destination
> >> would be created and if it were "queue://name" then a queue destination
> >> would be created?
> >
> >
> --
> View this message in context: http://www.nabble.com/Creating-destinations-t1809909.html#a4933102
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

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

Re: Creating destinations

Posted by Thomas Swindells <ts...@ndsuk.com>.
I guess that's a no then, unless I'm missing something the only option is to
manually strip off the topic:// or queue:// and then progmatically pick the
right call to make?

Thomas

James.Strachan wrote:
> 
> http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html
> 
> On 6/19/06, Thomas Swindells <ts...@ndsuk.com> wrote:
>>
>> Is there any way to create a generic destination from a String and have
>> ActiveMQ automatically create the correct Topic/Queue version?
>>
>> That is if the destination name was "topic://name" then a topic
>> destination
>> would be created and if it were "queue://name" then a queue destination
>> would be created?
> 
> 
--
View this message in context: http://www.nabble.com/Creating-destinations-t1809909.html#a4933102
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Creating destinations

Posted by James Strachan <ja...@gmail.com>.
http://incubator.apache.org/activemq/how-do-i-create-new-destinations.html

On 6/19/06, Thomas Swindells <ts...@ndsuk.com> wrote:
>
> Is there any way to create a generic destination from a String and have
> ActiveMQ automatically create the correct Topic/Queue version?
>
> That is if the destination name was "topic://name" then a topic destination
> would be created and if it were "queue://name" then a queue destination
> would be created?
> --
> View this message in context: http://www.nabble.com/Creating-destinations-t1809909.html#a4932438
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

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