CometD

CometD is a scalable HTTP-based event routing bus that uses a Ajax 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 is a project by the Dojo Foundation to produce a specification, the Bayeux specification, and a set of implementations of that specification.

Cometd Project Overview

The primary purpose of CometD project is to implement responsive user interactions for web clients using Ajax and using the server-push technique called Comet.

The CometD project provides the Bayeux specification, that defines the protocol used to exchange information between client and server, and provides (eventually) standardized APIs for servers and clients.

Currently the API bindings for JavaScript (on the client) and Java (for both client and server) have reached a stable status.

Bayeux Specification

The Bayeux specification is written in RFC style and is aimed at defining the interoperability aspects of the CometD project.

The protocol itself is open to extension and encourages multiple transport implementations.

Bayeux APIs

There is currently a common JavaScript API and implementation that has bindings for the Dojo toolkit and for the jQuery toolkit.

This means that no matter what JavaScript toolkit you prefer, the JavaScript code that uses the CometD API will remain the same (and that of course you have available CometD JavaScript API for both toolkits).

There is currently a Java client API and Java server API, living in the package org.cometd. It has been implemented by the Jetty project and is under review/consideration by other Java servers.

Other Implementations

The CometD project includes implementations of Bayeux specification in several languages, toolkits and servers. Third party implementations of the Bayeux specification also exist, and are not strictly part of the CometD project, however for completeness the third party implementations are linked off this document where appropriate. Other implementations and integrations include:

  • Cometd4GWT
  • Flex Cometd
  • Cometd Grails Plugin
  • Atmosphere bayeux
  • Oyatel's CometD .NET Client