The CometD project has finally released its 1.0 version !

I have already posted here about new features of the CometD project, but the 1.0 release is a further step forward in usability, stability and documentation.

For those of you that did not hear about the CometD project, it is a project that implements the Bayeux protocol to provide two-way seamless HTTP communication, from clients to server and from server to clients.

Any application that receives server-side events such as online games, online chats, online stock information, online sport results, online bet results, online content sharing, online social networking and so on is a potential perfect application that can use the libraries provided by the CometD project to greatly simplify development.

An event arrives on the server, and it is communicated to the clients with minimal latency via HTTP (and of course through firewalls, proxies, and more generally "through the web").

Such applications are generally dubbed as comet web applications (and you can read here who and when the term was coined).

The CometD project ships the following libraries to develop comet web applications:

  • A JavaScript library, with bindings for the well known Dojo and jQuery toolkits
  • A Java client library, to be used, for example, in rich Java clients such as Swing applications
  • A Java server library, to be used to implement the logic behind you application

There are also alpha version of Perl and Python libraries, and you can find more implementations at this page.

Greg already blogged about the cool features of the CometD project, but I would like to emphasize how simple is to create your first comet web application with CometD, using Maven:

$ mvn archetype:generate -DarchetypeCatalog=http://cometd.org
...
$ mvn install jetty:run

Two lines, that’s it, and the detailed guidance of the CometD primer.
You don’t need to download and install anything, you can just start with the CometD primer, and you are ready.
After that, you can import the Maven project into your favorite IDE, and use the Jetty Plugin to develop-deploy instantaneously.

The documentation has much improved, and now covers the 3 major libraries shipped, in details.
Add to that How-Tos and FAQs, and a completely searchable website, so that you can enter your query (try "howtos") and have the documentation page that refers to your search.

Do you use Spring for your server side plumbing ?
There are detailed instructions of how to integrate with Spring.

The CometD project is a 1.0 release, but has already been deployed in many applications that range from few users to a potential of million of users, and proved to scale really well. No worries on this side, <shameless-plug>especially when you can have a company that backs you up</shameless-plug>.

Enjoy !


1 Comment

Richard Green · 11/01/2011 at 02:53

The final release of CometD 1.0 provides the core operation of the Bayeux protocol by delivering messages to all subscribers for a particular channel, either locally in the server, remotely in the client, or remotely in the client of a clustered server.

JavaScript subscription must provide a callback to handle messages:
view source
print?

1.// Some initialization code

2.var subscription1 = cometd.addListener(‘/meta/connect’, function() { … });

3.var subscription2 = cometd.subscribe(‘/foo/bar/’, function() { … });

4.

5.// Some de-initialization code

6.cometd.unsubscribe(subscription2);

7.cometd.removeListener(subscription1);

To publish a method in JavaScript, simply pass the channel name and the message:
view source
print?

1.cometd.publish(‘/mychannel’, { wibble: { foo: ‘bar’ }, wobble: 2 });

Comments are closed.