wood burning stoves 2.0*
The moose likes Servlets and the fly likes Instant Messaging using JMS with the help of JSP and Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Instant Messaging using JMS with the help of JSP and Servlets" Watch "Instant Messaging using JMS with the help of JSP and Servlets" New topic
Author

Instant Messaging using JMS with the help of JSP and Servlets

Arindam Bose
Greenhorn

Joined: May 11, 2009
Posts: 4
HI Everybody,

I am creating a web application using JSP and Servlets which enables users to chat using JMS. I need to know how to know the solution to the following situation:


user1 and user2 are chatting with each other.
when user1 sends a message to user2 I use JMSQueue to insert the message at the server end.
But user2 retrieves the message from the queue only when I manually refresh the page or set the page to an autorefresh using a timer.

Please suggest how to overcome this drawback ie. how can I retrieve the message at the client end which is user2 only when the user1 submits the message ?

[P.S. Guys ....have you people stopped using JMS 4 IM services or what as all the posts date back to 2001....!!!]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

Unless you are using some technology like Comet to maintain (expensive) open connections, you'll need to resort to polling.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Arindam Bose
Greenhorn

Joined: May 11, 2009
Posts: 4
Thank you Sherriff ...... I am presently using polling to keep the service in working condition. But I need to be sure
that there is nothing more I can do programatically ....... also I need to know if there is ANY free technology available to mantain connections......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instant Messaging using JMS with the help of JSP and Servlets