I have a Web application (Flex 4 - Spring Blaze DS - Spring 3.0) which sends out an JMS event to a batch application (Standalone java)
I am using JMS infrastrucure provided by Spring (spring JmsTemplate,SimpleMessageListenerContainer,MessageListenerAdapter) with TIBCO EMS.
Is there any way by which we can notify a web user once message processing is completed by listener.
One of the way to send a response event which will be listened by web application; but how to address following scenario:
- User1 click on submit -> which in turn sends a JMS messag开发者_开发技巧e
- Listener on receiving message processes the message (message processing may take 20-30 mins to complete).
- Listener application sends out another JMS event "Process_complete"
- As this is a web application; there are n users currently logged into the application. so how to identify a correct user / what if user is already logged off?
Is there any way to handle this?
Please post your views.
In JMS i would use the ReplyTo Functionality together with temporary queues. When creating the Message you do also create a temporary Queue (with the createTemporaryQueue method of the Session) and set the JMSReplyTo Header to it. After that create a Consumer on the temporary Queue and start receiving. Maybe you want to give a timeout on the receive Operation and delete the temporary Queue after that timeout.
Some more thoughts on this can be found here: http://blog.temposwc.com/2010/03/asynchronous-jms-requestreply_25.html
I know only one way: create special notification queue and listen to this queue in your web application. When your listener implemented in stand alone application finished processing message it should send notification message to the notification queue.
精彩评论