|
Carol had previously (in July) posted an example of a SlideShow Using Comet; now she and Rick have a refined and expanded version where they provide more details, including screenshots, and also have modified the implemetantation so they NetBeans for development, MySQL and JPA for data presistence, Grizzly for Comet support, Jersey (JAX-RS) for the REST end-points, and GlassFish Server for the App. |
Looks very useful; check it out at
RESTful Web Services and Comet.
More information also at
Comet
,
Jersey
and
Grizzly
.
I'm biased, but I think it is really cool that examples like this can be ran in a totally open source stack, and you can also buy commercial support for it. We surely Are Not in Kansas Anymore!
Added - I am republishing this today since yesterday I had posted it into the past by mistake.
|
Comet uses either Streaming or Long Polling to Push Events from the server to the client through a protocol like Bayeux. Carol's A Comet Slideshow Example... shows, through instructions, screenshots and samples, how to do this using dojo on the client (JavaScript) and Grizzly on the Server on the GlassFish Server. Check it out! |
|
You may or may not know that Comet, Reverse Ajax, and Ajax Push are all synonyms and define a way to notify clients from a server. Jean-François has written many fine Comet blog entries, but this GlassFish v3 documentation on Comet is a very well written intro to the Comet paradigm and how to use it inside GlassFish v3 based on the Hidden example. You may also hear from Jean-François on Comet in a recent interview from this past JavaOne as well as read Ted Goddard's slide deck on IceFaces and Grizzly Comet from last week's GlassFish Day at Jazoon. |
The documentation also discusses the pros and cons of HTTP Streaming vs. Long Polling and explains how to code both.
|
I was going to wait until late next week, but I see that JFA's interview at InfoQ is out and the website is visible so no reason to wait. JFA's "free time" left by Alexey's lead role on Grizzly 2.0 is going to be reinvested into a Atmosphere a new project in the GlassFish Community that will focus on Comet. The project is just starting; the InfoQ article seems roughly accurate although some goal fine-tuning is still happening. I expect JFA will provide a more detailed description in a future blog entry. |
|
Shin Wai Chan has a nice set of blog entries ([1], [2]) on Comet (aka AJAX Push). He goes on to describe the code on both the client and the server and provides a link to a ready-to-use archive. The second part refines the introduction by describing the use of HTTP streaming.
Although they are documented with an earlier version of GlassFish v3, they apply equally to the latest TP2 promoted build provided you start GlassFish with this |
Comet is not Ajax, it's not polling, and it's not traditional servlet either. This set of short articles is a good way to grasp the Comet paradigm.
Update: Jim has a refined version of Shin's example.
|
Paul is announcing the availability of JAX-RS v0.5. As with previous releases, this one is synchronized with Jersey v0.5, its Reference Implementation. Traditional delivery vehicles such a the GlassFish Update Center and NetBeans will soon follow (Maven should be already there). Among new things, Jersey has an improved deployment and configuration process (courtesy of Grizzly and asm) and a rewritten URI dispatching architecture. Paul has more details in his blog entry. |
Both the JSR and the reference implementation are developed in a very collaborative way. Schedule leading up to version 1.0 is here.
|
Interesting Comet use-cases seem to be popping up on a regular basis. This time around IceFaces' Ted is showcasing the WebMC sample application to host a slide presentation over the internet. You can host your own infrastructure (maybe a great new feature for java.net) and check a demonstration here. |
In the latest version of this fully-documented-but-not-yet-final software, the interesting part is the use of Grizzly Comet to scale to a very large number of connections without killing the server with threads (ARP at work here). Unfortunately, I don't believe Skype scales as well in the number of simultaneous connections. Does anyone have a suggestion for an alternate solution for a one-to-many broadcast? A streaming solution maybe...
|
Jean-Francois has put a lot of work into making Grizzly (and, by extension, GlassFish) fully capable of servicing Comet applications. He has also worked on documentation, providing an example of the server-side code for a Comet-enabled application in his blog. It's great stuff, but left readers with one obvious question: what about the client side? Well, now Jean-Francois has that one covered too. In his latest blog entry, he shows how to write the client portion of a Comet app. His example uses the Prototype and Behaviour JavaScript libraries, and--of course--it runs on GlassFish. |
|
More progress on practical delivery vehicles for jRuby: JeanFrancois has taken the latest Grizzly (1.5 SNAPSHOT) and combined it with jRuby. The resulting JAR file can be used to start your Ruby app. Check JFA's writeup for the details. Moving forward, JFA and Jerome are working to better integrate Grizzly 1.5(.1) with GlassFish v3. The intention is to change the typical use from this to this. I think the resulting combo is going to be a killer app. Check JFA's entry and the slides of their JavaOne BOF. |
|
The Bayeux Tapestry is a famous depiction of the Battle of Hastings. The tapestry is also famous because it shows Halley's Comet so it is fitting that the name for the protocol proposed for Comet (see Ajaxian or TheAquarium) is Bayeux. |
Bayeux is JSON based and allows a COMET client to interact with a server. CometD is an implementation but the protocol should enable others, and JeanFrancois and TAKAI have collaborated to do exactly that using Grizzly. This gCometd can be used in GlassFish expect it in a future build of GlassFish v2. For all all the details check JeanFrancois' blog, but stay tuned for more samples and improvements, specially now that TAKAI has been voted a Grizzly committer.
BTW, I don't want to brag, but check the picture in our intro from last October! :-)
|
Ashish has been spending some time on Ruby on Rails and on GlassFish and has written a number of articles on how to combine the two technologies (TA entries). He just published a new blog entry describing in detail how to use Grizzly in GlassFish with jRuby and RoR using TAKAI Naoto's contribution. Still a bit too many steps for my liking, but steadily moving in the right direction... |
|
Jean-Francois continues to work on Grizzly and Comet. Last month he provided a simple Chat client on GlassFish that explains how to configure Comet support in GlassFish and how to write the corresponding server-side Java: for polling and for request processing. Then Takai (of jRuby fame) joined in (see TAKAI's blog). He says he has an AJAX-based chat and there is a (simple?) live chat here. Also note that Grizzly is on its way to become a separate top-level project at Grizzly.Dev.Java.NET, although the code has not yet moved there; see JFA's blog. |