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 11:17:04 GMT
On 5/3/06, Charles Anthony <charles.anthony@hpdsoftware.com> wrote:
>
> On 5/3/06, Aleksi Kallio <aleksi.kallio@...> 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);
> >
>
> Hi - not withstanding James's response, is there any reason why you have to
> deal the name of the temporary topic, rather than the actual destination
> itself ?
>
> Destination authoriseTo = session.createTemporaryTopic();
>
> to.setObjectProperty(KEY_AUTHORISE_TO, authoriseTo);
>
> ...
>
> Destination authoriseTo = (Destination)
> from.getObjectProperty(KEY_AUTHORISE_TO)
>
> We pretty much do that (well, we pass the temporary queue in the
> Message.replyTo attribute) and it all works fine.

JMS providers explicitly deal with the setJMSReplyTo() being a
destination - however you cannot usually send destinations on
arbitrary properties; its against the JMS spec so you have to convert
them into Strings.

(We could consider enabling destinations to be added to properties on
messages but it would have to be disabled in J2EE / JMS compliant mode
I suspect)

--

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

Mime
View raw message