The app that we'er building need to send back one HTTP response to one HTTP request, optionally followed by follow-up HTTP responses that might be seconds or even minutes late. What's a good way/tool to do this? Thanks.
You mention about the second response being optional follow-up response. Maybe you should look at asynchronous processing such as JMS or Message-Driven-bean
The problem is that the follow-up response needs to go to the browser that issued the riginal HTTP request. It would be better if the follow-up response is also an HTTP response, but it does not have to be. Does the servlet model or other frameworks do this?
The only way to do this as an HTTP response is to keep the connection open from the browser, and the servlet thread running, and keep writing responses back periodically. Obviously, this is not scalable.
Someone suggested using JMS. You can send messages to a specific target with JMS. You can publish the message from the server with a message attribute indicating who it's meant for, and have the subscribers (browsers) use selectors to filter on the attribute.
If that's not acceptable from a security perspective, you can create temporary queues/topics dynamically. I believe it (creating dynamic queues) is not J2EE standard, but app servers do support it. I know weblogic does.