JavaOne 2012 Tutorial by Steve Millidge - Programming WebSockets with Glassfish and Grizzly

Programming WebSockets with Glassfish and Grizzly from C2B2 Consulting

WebSocket is coming with HTML5, and building rich real-time event-driven Web applications will be the future. GlassFish, as of Release 3.1.2, now supports WebSocket, so now is an ideal time to learn this new technology. This tutorial builds a WebSocket Web application hosted on GlassFish that can deliver stock updates from a data grid directly to the Web browser in real time. It starts by introducing WebSocket and the APIs for building a server-side WebSocket application in GlassFish. It then moves on to the client side and builds an updating stock ticker, using HTML5’s Canvas and JavaScript. For a final flourish, the presenter hooks up GlassFish to a data grid that will deliver updates at scale in real time.

The tutorial session was presented by Steve Millidge at JavaOne 2012 on the 4th of October 2012.

The code is up and running on Amazon EC2 so you can see for yourself whether WebSockets works on your device.

There are 2 code downloads:

Highcharts will need to be unzipped in the root of the web source tree and coherence will need to be configured as a library in NetBeans.