Home > Uncategorized > @ MUST \!A = 4\pi r^2 : Atmosphere 0.5 is released

@ MUST \!A = 4\pi r^2 : Atmosphere 0.5 is released

Atmosphere 0.5 is released. This release includes many new features like Guice Support, asynchronous request processing, JMS support, JQuery support, Events listeners, etc..


The community around Atmosphere is shaping and we have received many good feedback, which is reflected by the new features added:

Guice Support: Now quite simple to integrate with Google Guice using the new AtmosphrereGuiceServlet.

As simple a:

    protected void configureServlets(){
        Map params = new HashMap();
        params.put(PackagesResourceConfig.PROPERTY_PACKAGES, "org.atmosphere.samples.guice");
        serve("/chat*").with(AtmosphereGuiceServlet.class, params);

New Broadcaster: Easy Asynchronous HTTP Request Processing

The new set of Broadcaster allow you to do full asynchronous http processing, similar to what RESTEasy offer:

public class SimpleResource
   public Broadcastable getBasic(final @PathParam("topic") JerseySimpleBroadcaster broadcaster)                    throws Exception
      Thread t = new Thread()
         public void run()
               Response jaxrs = Response.ok("basic").type(MediaType.TEXT_PLAIN).build();
            catch (Exception e)
      return new Broadcastable(broadcaster);

New AtmosphereResourceEventListener

You can now listen to events like resume, client disconnections and broadcast.

    public Broadcastable subscribe() {
        return broadcast("OK");


public class EventsLogger implements AtmosphereResourceEventListener {

    public EventsLogger() {

    public void onResume(AtmosphereResourceEvent event) {

    public void onDisconnect(AtmosphereResourceEvent event) {

    public void onBroadcast(AtmosphereResourceEventevent) {

The Meteor now supports scheduled and delayed events broadcasting

If you want to use Atmosphere without re-writing your Servlet based application (or don’t want to use the Servlet 3.0 Async API), you can use a Meteor instead and do all the same operation as when you use the annotations:

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
        Meteor m = Meteor.build(req, list, null);

        // Log all events on the concole.
        m.addListener(new EventsLogger());

        // Periodic events broadcast
        m.schedule("Atmosphere is cool", 10, TimeUnit.SECONDS);

Build in Framework support for different browser behaviors and proxy

The Framework is now adding the proper headers required to make it work with any proxy. The framework also make sure all browsers work out of the box by writing some default comments when a response get suspended so browser like Chome and Webkit works properly. The framework is also taking care of errant connections when hot deployment happens.

Improved algorithm for WebServer detection like App Engine, Tomcat, Jetty and GlassFish

The Framework is auto detecting which WebServer is running on in a more efficient way. The behaviour is also configurable by adding, in web.xml:

  <param-value>AN EXISTING CometSupport implementation, or a customized one</param-value>  

JMS support

You can now cluster your application using JMS, Shoal or JGroups

    public Broadcastable publish(@FormParam("message") String message){
        return broadcast(message);

Annotation improvements

All annotations has been reviewed and some cool functionality added like resumeOnBroadcast, event listeners, etc. See the API for more information.

JQuery Support

See how simple it can be here.

Better Control of BroadcastFilter state, allowing easier agreggation/filtering/runing of events

If your application extensively broadcast events, it is important to pick up the right strategy to make sure all events reach your clients as fast as possible, even under high load. BroadcastAction has been added to make the writing BroadcastFilter’s aggreagation/filtering/pruning of events really simple.  Simple as

    public BroadcastAction filter(Object message) {
        if (message instanceof String){
            if (bufferedMessage.length() < maxBufferedString){
                return new BroadcastAction(ACTION.ABORT,message);
            } else {
                message = bufferedMessage.toString();
                bufferedMessage = new StringBuilder();
                return new BroadcastAction(ACTION.CONTINUE,message);
        } else {
            return new BroadcastAction(message);

Powerful PubSub sample

Take a look at our PubSub sample that demonstrate all the power of Atmosphere!!! We also improved our white paper (PDF).


As usual, Thanks to Matthias (ADF Faces), Paul (Jersey), Viktor (Akka), Hubert (Grizzly) and Catagay (PrimeFaces) and all the users for their contributions to Atmosphere! Special Thanks to Ning for allowing me to work on this project (and Thanks to Sun before Ning!).

For any questions or to download Atmosphere, go to our main site and use our Nabble forum (no subscription needed) or follow us on Twitter and tweet your questions there!

Categories: Uncategorized
  1. December 17, 2014 at 2:58 pm

    Hey There. I discovered your blog the use of msn.
    This is a really well written article. I will be sure to bookmark it and come back to read extra of your useful info.

    Thank you for the post. I will certainly return.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: