David Titarenco
David Titarenco

Reputation: 33396

comet HTTP patterns in Java

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.

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..

Upvotes: 6

Views: 2426

Answers (4)

goldierox
goldierox

Reputation: 1085

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/

Upvotes: 0

Predrag Stojadinović
Predrag Stojadinović

Reputation: 3659

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

Upvotes: 0

TheSteve0
TheSteve0

Reputation: 3526

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?

Upvotes: 0

Michael Barker
Michael Barker

Reputation: 14378

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.

Upvotes: 2

Related Questions