WebSockets is the way forward of pure web applications
Today I attended the first day of the two-day JFokus conference in central Stockholm. In just three years it has become one of the major Java events in the Scandinavian region. The first day was composed of two half-day sessions. I decided to go for websockets before lunch and performance tuning after lunch.
The first session regarding the part of the upcoming HTML 5 specification, called WebSockets and Server Side Events, was really, really interesting. Everybody, that have tried various ways of pushing data from the server to the web clients, know how difficult it is.
For some period of time, people used fat clients (like JavaSwing@WebStart) to connect to the server and then keeping a full-duplex bi-directional socket stream open. However, as more and more internet threats have emerged security guys tend to block all incoming ports except 80 and 443 for applications to use - reasoning like HTTP is decent protocol and well-understood and the web servers (like Apache) are very robust as well. That have put a burden on us developers to invent protocol tranformers, typically performed by some servlet, used to act as gateways between some back-end system and the front-end browser. Everybody, that have tried this knows how intricate it quickly gets. Why, cannot the browser subscribe directly to a JMS topic and react on incoming messages?
This is exact the kind of question, people behind the WebSockets upcoming standard have been asking and decided to provide an answer for.
A web socket creates a bi-directional HTTP tunnel and within, it can transport application level protocols such as XMPP, STOMP, IMAP/SMTP and many more. From an internet technology point of view, this is the best thing happened since the the invention of sliced-bread.
The second session, after lunch, on the other hand was a little bit disappointing. It was presented by Kirk Pepperdine of JavaPerformanceTuning. However, he had many problems with the both the presentation device (not his fault) and the demoes (his fault). My impression was that he wasn’t really well-prepared. Having a background myself, in both training (10+ years) and performance tuning (2+ years), I must say this was below par. Never ever run a live demo without tripple-checking everything and keep some screen-shots up the sleeves, if running into disasters (shit happens indeed).
The first session was presented by Jonas Jacobi of Kaazing, which seems to have been heavily involved in the realization of the new standard. The point is, there are no browsers yet supporting HTML 5 or WebSockets. Kaazing provides an open-source emulation layer that fully implements the standard that can be used in the meantime. I’m really looking forward to get some time playing around with this new exiting technology.
