background preloader

Websocket

Facebook Twitter

Blog: Tech: A Rough Guide to Atmosphere with Spring, Tomcat & Jersey: Avoiding the Pitfalls. Welcome to the second installment of the NerdAbility tech guide series.

Blog: Tech: A Rough Guide to Atmosphere with Spring, Tomcat & Jersey: Avoiding the Pitfalls

This post looks at the Atmosphere framework! Enjoy.... Edit: I Previously forgot to include the project sources and people have rightly asked in the comments about it. I couldn't find the example I wrote this blog post from, but I found a similar example on my github. You can find it here More and more it's becoming a common requirement to support some sort of bi-directional (asynchronous) channel in modern web applications. Having run through the process once I thought it'd be nice to cover my implementation in some detail. This is what I had in place before integrating atmosphere. Properties: Dependencies: Just a quick note about the cors-filter dependancy, you'll only need it if you want Cross-Origin-Resource-Sharing support. If you're not using servlet 3 already, time to upgrade. The next step is to include the standard spring dispatcher etc to your configuration.

Also very simple. Powering the Atmosphere Framework. Introduction The Atmosphere Framework is a Java/Javascript framework which allows the creation of portable asynchronous applications using Groovy, Scala and Java.

Powering the Atmosphere Framework

The Atmosphere Framework ships with a JavaScript component supporting all modern browsers and several server components supporting all major Java-based WebServers. The aim of the framework is to allow a developer to write an application and let the framework discover the best communication channel between the client and the server, transparently. For example, a developer can write an application that will use the WebSocket protocol when used with a browser or server that supports the protocol, and transparently fall back to HTTP in case the WebSocket protocol isn’t supported. For example, an Atmosphere application will work fine with Internet Explorer 6, 7, 8, and 9 using HTTP, and will use the WebSocket protocol when used with Internet Explorer 10.

To see the power of Atmosphere, let’s build a simple chat application. Listing 3. Demos. Advanced Message Queuing Protocol. The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware.

Advanced Message Queuing Protocol

The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security.[1] Overview[edit] AMQP is a binary, application layer protocol, designed to efficiently support a wide variety of messaging applications and communication patterns. It provides flow controlled,[3] message-oriented communication with message-delivery guarantees such as at-most-once (where each message is delivered once or never), at-least-once (where each message is certain to be delivered, but may do so multiple times) and exactly-once (where the message will always certainly arrive and do so only once),[4] and authentication and/or encryption based on SASL and/or TLS.[5] It assumes an underlying reliable transport layer protocol such as Transmission Control Protocol (TCP).[6] History[edit] Type system[edit] What is WebSocket? » Heart of the Living Web. HTML5 WebSocket represents the first major upgrade in the history of web communications.

What is WebSocket? » Heart of the Living Web

Before WebSocket, all communication between web clients and servers relied only on HTTP. Now, dynamic data can flow freely over WebSocket connections that are persistent (always on), full duplex (simultaneously bi-directional) and blazingly fast. The WebSocket standard enables entirely new kinds of applications, just as the Web itself originally did. Businesses can now leverage this new technology to tap novel sources of revenue, reduce time-to-market, and slash the costs and complexity of their IT infrastructure. The main purpose of WebSocket is to provide full-duplex communications channels over a single TCP connection that can support any protocol.

What WebSocket means for businesses The Web is moving into its next phase morphing from a static and stale network to a live, interactive, and constantly changing mesh of communication and connectivity, a living Web. What WebSocket means for IT.