Cometd is a scalable HTTP-based event routing bus that uses a push technology pattern known as Comet. The term ‘Comet’ was coined by Alex Russell in his post ‘Comet: Low Latency Data for the Browser‘. Cometd consists of a protocol spec called Bayeux, javacript libraries (dojo toolkit), and an event server.
Jetty now has just an implementation of the cometd event server that
uses the Continuation mechanism for asynchronous servlets.
Jetty already has comet implementations for DWR and activemq, but both of these use custom protocols which can lead to interoperability problems that cometd intends to solve.
Because browsers commonly permit only two connections to each server, it is not possible for a web page to use more than one Ajax library that is using comet techniques. The intent of cometd is to define a common protocol that can be shared between libraries and thus
encourage interoperability.
Cometd provides a two multi-channel communications paradigm that allows asynchronous message delivery from server to client as well as client to server. The multi-channel nature of the protocol, will eventually allow a single comet connections to be shared between multiple Ajax toolkits
Jetty has implemented the server side of this protocol, which will allow it to be used with whatever client side implementations emerge (currently only dojo, but I plan to port activemq once it is stable). However to achieve true
interoperability, we will need to develop standardized APIs on both the client and server side. Having standard protocol is a start on this, as it defines the capabilities that will need to be expressed in the APIs


17 Comments

Anonymous Coward · 07/08/2006 at 15:03

I was thrilled to see Cometd being implemented in Jetty.  I’ll be even more thrilled once it’s wired up to a JMS broker (like ActiveMQ).

Anonymous · 02/09/2006 at 21:38

The “implementation” link
http://svn.codehaus.org/jetty/jetty/trunk/modules/cometd/
leads nowhere. Is the cometd module available?

Hemasa · 14/10/2006 at 13:46

Hi,

Will it support Reverse Ajax as it is there in DWR?

Is there  any working example where the server is pushing data to the client?

Chris Bucchere · 21/11/2006 at 19:59

Last night I put together a little Comet hello world using org.mortbay.cometd (Jetty) as the server and dojo.io.cometd as the client. Sorry for the shameless plug, but if you’re interested, please check it out.

katy · 02/01/2007 at 21:21

We are using cometd on a project at my company and have run into an issue that we could really use some help with.

We are using JBoss with Tomcat 5.5 and I was hoping to keep things that way, so I put the cometd and jetty jar files into my webapp.  What appears to be happening is that when two or more clients are connected through the cometd servlet (using dojo.io library), only the last client within the subscribers list will actually have a message delivered to them.  After some debugging, it looks like only that last client actually has a Continuation.  Is this possibly a by-product of using Tomcat instead of Jetty, or do you think there might be something else going on?

Greg Wilkins · 06/01/2007 at 08:44

Almost certainly something is wrong….

probably best if you send an email to the cometd dev list and we can help you there .  Difficult to have a conversation in blog comments

Dominique · 05/07/2007 at 16:39

Hi,

I went to the new link http://svn.jetty.codehaus.org/browse/jetty/jetty/trunk/extras/cometd, but the zip i get there is corrupted. The cometd folder is not in the parent directory either. Could you tell me where you moved it?
Many thanks.

Bashar · 15/08/2007 at 14:08

Is there any concrete example of working out reverse ajax (dwr2) with Jetty ? i could not find any !!!

I have reverse ajax application but it is eating the memory like hell. I think by using Jetty the problem might disappear.

eman · 02/06/2009 at 09:56

Hello,
Is cometd can run on websphere app server? glassfish?
Thanks a lot.
Cheers.

Greg Wilkins · 02/06/2009 at 15:30

cometd should run on any app server, but it will scale best on jetty or a servlet 3.0 container.

eman · 03/06/2009 at 13:30

Hello greg,
Have encounter grizzly? what is the advantage and disadvantage of grizzly over cometd?
Thanks a lot.

Greg Wilkins · 04/06/2009 at 06:28

Eman,
I’ve not looked at grizzly for a while, but it’s intent was to be a general purpose NIO layer which can be used for many purposes, one of which is extending async behaviour into a servlet container.
Jetty has a specific purpose NIO layer – it is there to do HTTP and only HTTP. As such I would expect that we could optimize it better and the direct benchmarks that I have seen (albeit some time ago) did show that we were significantly faster than grizzly.

Web Performance · 14/06/2009 at 11:00

Any progress on this? An update would be really useful.

eman · 16/06/2009 at 00:00

Hello greg,
I was assigned to different task for now but I will be doing comet hopefully by the end of this month. By then I should be updating you soon.
Thanks a lot.
Cheers.

eman · 16/07/2009 at 10:25

Hello greg,
Im doing comet now and I cannot run my comet enable app using wicket. Also i already read the forums here http://www.nabble.com/-Announce–wicketstuff-push-ported-to-use-wicket-1.4-jetty-6.1.14-to20914051.html specific to UI framework im using and it seems that can only work on jetty server. I also check the glassfish doc http://docs.sun.com/app/docs/doc/820-4496/ghgxn?a=view for suport on comet, i just found this docs and done some integration but i cannot make it work.
Is there a way to do this in glassfish?
Thanks a lot.
Cheers.

URL · 22/03/2013 at 13:41

… [Trackback]…
[…] There you will find 16751 more Infos: webtide.intalio.com/2006/08/cometd-with-jetty/ […]…

Comments are closed.