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: Passing temporary topics on a message
Date Wed, 03 May 2006 08:28:25 GMT
On 5/3/06, Aleksi Kallio <aleksi.kallio@csc.fi> wrote:
> > Temporary topic names already are globally unique in ActiveMQ.
>
> Exactly, that's way I would like to use them.
>
> > How are
> > you converting from temporary topic to string and back again? Maybe
> > we've just gotta tweak that code a little to get your code to work.
>
> Relevant lines of code are...
>
> Topic marshalling:
>
> // to is instance of MapMessage
> to.setStringProperty(KEY_AUTHORISE_TO, authoriseTo);
>
>
> Unmarshalling:
>
> // from is instance of MapMessage
> authoriseTo = from.getStringProperty(KEY_AUTHORISE_TO);
>

I'd replace these lines of code with...


> Topic name initialisation:
>
> // authoriseToTopic is instance of Topic
> authoriseTo = authoriseToTopic.getTopicName();


authoriseTo = ((ActiveMQDestination) authoriseToTopic).getPhysicalName();


> And topic recreation on the replying end:
>
> topic = session.createTopic(authoriseTo);

topic = new ActiveMQTempTopic(authoriseTo);

and it should work.

The main issue is that the last line you typed (session.createTopic)
will create a regular topic, not a temporary topic.

--

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

Mime
View raw message