There was some discussion last night regarding the use of JMS behind altRMI to
make asynchronous calls. Taking the idea further, I wondered if it might be
possible to implement asynchronous callbacks using temporary queues. So
requests that take a long time, but need to return a response to the user could
present a ‘please wait…’ message, or pop up an alert when the response has
arrived, without the client having to poll the server.
Some sample code I found here
looked a bit like this:
Queue tempQueue = qSession.createTemporaryQueue(); TextMessage request = qSession.createTextMessage(); request.setJMSReplyTo(tempQueue); QueueReceiver qReceiver = qSession.createReceiver(tmpQueue); qReceiver.setMessageListener(new MyMessageListener(. . .));
Could be interesting, perhaps.