activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Creating destinations
Date Mon, 19 Jun 2006 10:11:19 GMT
On 6/19/06, Thomas Swindells <tswindells@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 <tswindells@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/

Mime
View raw message