views:

344

answers:

4

I'm writing/porting a C++ HTTP event server to Java. I'm wondering what are the best paradigms for implementing comet with Jetty, Tomcat, any other server, or natively.

  • Threaded
  • Continuations
  • NIO
  • Servlet 3.0

Scalability is an absolute must as I'm developing a new protocol that uses up to 3 concurrent connections per client.

Any help is appreciated.

PS: If possible, I would love to also see some sample code or tutorials..

+1  A: 

We've had a lot of success with Caucho Resin's LongPoll features (the majority of the data to our UI comes in over Comet). Caucho has also added support for WebSockets, so if you have an HTML 5 client you can benefit there too.

On Linux they have some custom JNI code that talks directly to epoll, which allows the server to scale well.

Michael Barker
A: 

Glassfish has native comet support and I thought there was WAR for comet support in tomcat from the Glassfish team. Jetty also seems to be leading the crowd. Am I misunderstanding, but why are you trying to re-implement comet in a Java app Server?

TheSteve0
A: 

Or you can drop Comet and go WebSockets: http://www.jWebSocket.org

DrCoPe
A: 

I've been looking into Comet myself the past couple days. My company uses Tomcat in development and WebLogic in production. We'd like to incorporate Comet without shaking up our existing application. I've been impressed with Atmosphere's APIs. It focuses on the server side, allowing for portability while taking advantage of native server features like NIO. They seem to be putting out updates every month. https://atmosphere.dev.java.net/

sethmachine7