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 !
Posted at 09:46PM dic 17, 2009 by Simone in Java | Comments[0]
Jetty supports Cross-Domain XMLHttpRequests
The release of Firefox 3.5 included support for cross-domain HTTP requests made with XMLHttpRequest objects, and Jetty already supports it.[Read More]
Posted at 11:22PM ago 04, 2009 by Simone in General | Comments[0]
JavaScript Cometd Implementation Refactored
The Dojo project has pioneered the implementation of the Bayeux specification, but for example the jQuery project lacked a robust client-side Cometd implementation.
This gap has been filled now, with a shared pure-JavaScript implementation and bindings for both Dojo and jQuery.
This means that the bulk of the Cometd implementation is now in a single, pure-JavaScript file, and that users of either toolkit have a binding (a very small adapter code) that allows developers to use the JavaScript Cometd API as a first class citizen in the either toolkit.
As a small example, this is how you use it in Dojo:
dojox.cometd.publish('/mychannel', { mydata: 'foobar' });
and this is how you use it in jQuery:
$.cometd.publish('/mychannel', { mydata: 'foobar' });
A good side effect of all this is that every bug or new feature is fixed or added to the shared pure-JavaScript file, and immediately both toolkits will benefit of that.
The implementation has been totally rewritten since the one historically present in Dojo, and the following are the most interesting features:
- better support for tweaking the configuration
- split configuration and initialization steps to allow more flexibility in case of programmatic disconnects
- extended and clarified the Cometd APIs
- better notifications for failures due to server or network failures
- automatic and configurable connection retries
- incoming message and outgoing message interception
- automatic bayeux transport negotiation, supporting long-polling and callback-polling transports
- extensions such as timesync, message acknowledgement and transparent page reload
Downloads, documentation and code is available at the Cometd website.
Posted at 09:37PM lug 29, 2009 by Simone in General | Comments[0]