You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Condotta <mi...@condotta.co.uk> on 2011/04/18 11:59:25 UTC

Stomp Temp Queues

I'm using Stomp from a Java client. I'm doing this because I need something lighter than JMS as I am running on mobile devices. I want to implement a response reply setup using temporary queues. It's sort of working but the trouble is I'm not quite sure how it does. I know the Stomp protocol does now support temp queue create by using temp-queue. So I have a


connection.open

connection.subscribe("/temp-queue/Client1")

 
the above will actually create a temporary queue on the broker with a unique indetifier. As you would expect it overwites what I pass which makes sense as the broker needs to make sure the temporary queue is unique. I then send a message to a normal queue with a header value

 
"reply-to" , "/temp-queue/Client1"

 
I have a consumer listenening on the normal queue and sending messages to the destination in the NMSReplyTo. What I don't understand is how does this work. The reply-to I'm setting is not the actual Destination as this has been created by the broker. I debug the message that is received and the reply-to does contain the correct temp destination so it's somehow managing to get the correct one. I haven't tried this with multiple clients so I can't say whether it actually would work properly. But what is the expected bnehaviour and how is it managed. Is it possible to write request reply with STOMP and use temp queues ?

 
Many Thanks

 
Mike



Re: Stomp Temp Queues

Posted by mgiammarco <mg...@gmail.com>.
Can you let me see your working example of temp queues with stomp? I am not
able to make them.

Thanks,
Mario

--
View this message in context: http://activemq.2283324.n4.nabble.com/Stomp-Temp-Queues-tp3458356p4267597.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Stomp Temp Queues

Posted by Aleksandar Ivanisevic <al...@ivanisevic.de>.
Condotta <mi...@condotta.co.uk> writes:


[...]

> it's somehow managing to get the correct one. I haven't tried this
> with multiple clients so I can't say whether it actually would work
> properly. But what is the expected bnehaviour and how is it
> managed. Is it possible to write request reply with STOMP and use temp
> queues ?

I've been using this scenario with STOMP and multiple queues/clients
(100+ clients, 30+ queues) for quite some time and had no problems
with it.

in a request you write reply-to: /temp/something, broker rewrites it
on the fly to /remote-temp-queue/pseudorandomgarbage and your consumer
replies to it and broker then maps it back to /temp/something on the
consumer side.

The only problem is getting the timings right (actually not STOMP
related at all), i.e. setting the expires header just above the time
you are actually going to wait for the reply + the time required for
the processing, otherwise you'll end up with a lot of garbage in
deadletter queues and in the logs when/if your producers go away too
soon.

-- 
Ti si arogantan, prepotentan i peglaš vlastitu frustraciju. -- Ivan
Tišljar, hr.comp.os.linux