• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

General question about java and servers

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

I'm looking to build a whiteboard/chat application in java.
So basically if 2 people on different computers are each running the program....
I would like each one to receive/send data instantly, so its like chatting in real time.

I currently use a J2EE server, the best I can currently do is to use polling,
by polling the server several times a second to see if the other use has sent any data.
But this is always a bit laggy, and not very smooth.

I'm looking into the following technologies, but am not sure what will work, and how to implement it:
a) comet, my current hosing doesn't allow this.
b) VPS
c) Dedicated servers

Can anyone say which idea might work, and how I might implement it.

Thanks very much.
 
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically what you need is a common message server where you can register a client to get the messages. If you have a thread that is only dedicated for waiting for new messages on the queue, then it will be quite smooth.

A basic JMS chat server can be found at http://oreilly.com/catalog/javmesser/chapter/ch02.html

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I actually have that book "Java Message Service", but haven't really looked into it.

My webhost uses a tomcat server, and I have a couple of live webapps (by uploaded war file to server, and getting it deployed) already in use.

I don't know if this is sufficient to use JMS, when I try to find out by reading the book, I tend to get bogged down in technical details, when I just need straight answers.

Do you think my webhosting (www.itanets.co.uk) will allow JMS, by using war files? Thanks for the input.
 
Ove Lindström
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

colin shuker wrote:Do you think my webhosting (www.itanets.co.uk) will allow JMS, by using war files? Thanks for the input.



Well, I won't even try to answer that. Just want to ask you a question. If you own a Nissan Micra and need to move your apartment, do you get a bigger car that is suitable for the job or do you invent a way to shrink all your furniture to fit the Micra?
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While it would be preferable to run separate servers (like mail or messaging) as separate processes, it's generally possible to run them embedded in Tomcat (assuming that they're implemented in Java, obviously :-). Check out open source servers like ActiveMQ, OpenJMS, OpenMQ and HornetQ.

Of course, for a JMS server to be of any use you'd need a messaging client. I'm not sure if those servers have some sort of HTTP interface that you could access via JavaScript. Assuming that you're talking about web clients - you haven't really talked about that. If you want to write standalone clients in Java then those could act as JMS clients directly.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic