activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beep02 <peter.kov...@gmail.com>
Subject emulate synchronous response, need suggestion
Date Sun, 08 Jan 2012 13:03:39 GMT
Hi,

I emulate synchronous HTTP communication(that is requirement):

1. I send http request to the Servlet from a browser.

2. Servlet opens connection to the remote queue/server and send the message
there.

At the same time new Temporary queue opened to accept reply messages for
each new HttpSession.
(such a way 1 client with 1 session has 1 queue for all replies to him)

3. Server(the side, that keeps remote queue) returns reply to the temporary
queue of the client.

4. Here is the problem:
I can put each request thread in 1 sec. loop for say 10 seconds , trying to
filter replies from the TEMP queue and if correlation ID, sent in response
matches, consider, that I have the response and so stop looping and send the
response to the browser.

But this is not efficient, if simultaneously 300 clients send me requests, I
should keep 300 threads busy in accepting replies, while most of the work is
in unproductive looping.

How can I release the request thread and in the same time keep user in wait
without response?
Is there some way to achieve that?

Thanks a lot.
Peter





--
View this message in context: http://activemq.2283324.n4.nabble.com/emulate-synchronous-response-need-suggestion-tp4275617p4275617.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message