Get going with Kaazing WebSocket Gateway – HTML5 Edition – installing locally and running demos

2

My last few articles on this blog site have all dealt with push architecture and technology in some way. This is an area that I have been investigating into quite bit recently. Part of these investigations had to be of course Kaazing, a specialized commercial offering, specifcally around WebSockets and its application in new HTML 5 application architectures.

Kaazing suggests a new way of implementing multi-tier (web) applications.

Image

Communication between client and back end services happens over WebSockets. The Kaazing Gateway handles all WebSockets communication, turning messages from various back end services based on technologies such RSS, XMPP, JMS into WebSocket events.

Image

Kaazing supports a variety of clients – though HTML 5 (JavaScript) web clients (including those running on mobile devices) are probably the most prominent ones.

Image

A typical setup for HTML5 clients seems to be: download static HTML pages (along with JavaScript libraries) from a WebServer, then open WebSocket to Kaazing server and do all communication through the WebSocket. This would be quite a paradigm shift – as for the people at Kaazing, there is no need for (classic) JEE Application Servers anymore! (refer to: http://www.businesswire.com/news/home/20111019005426/en).

I find it hard to find documentation on configuring the Gateway and the back end services it will interact with. Particularly a setup which combines my existing JEE Web Applications and the Kaazing Gateway for push style interaction is not readily described anywhere it seems. Perhaps that is not necessarily the way the Kaazing team wants to go. Note that the Kaazing JMS Edition offers a possible way: messages published to JMS Topics can be picked up by the Kaazing Server to be forwarded to connected (WebSocket) Clients. This would offer a way to have the JEE Server push messages via JMS to Kaazing and from there to the clients.

Get going with Kaazing

It is easy to get going with Kaazing in your own environment. The steps I went through to get Kaazing setup locally and run the demos are the following:

1. Download Kaazing Server at http://kaazing.com/download

Image

2. Unzip downloaded file

Image

3. Start the Gateway

Image

The console opens:

Image

4. Access the Kaazing Server in a browser:

Image

and navigate to the demos

6. Pick the Echo Demo (the quintessential WebSocket demo it seems)

Image

7. Click on Connect, Click on Send and see the response (echo) from the WebSocket server. That was the first WebSocket exchange between HTML client and Kaazing server.

Image

8. Run the Echo Demo as Java (Applet) Client:

Image

When the Applet has loaded, click on Connect, then on Send:

Image

9. Run a demo that has a Java backend send data packets over UDP to the Kaazing Server that then forwards these packages to the client as Server Sent Events.

For this to run, first start the Java backend that sends the UDP packets. This is done by running the demo-services.bat script in the bin directory of the Kaazing server installation:

Image

The following command window appears:

Image

Now the HTML demo client can be run. Click on Connect.

Image

When the connection is open, events start arriving.

Image

Multiple channels can be opened in the client:

Image

and even more:

Image

10. The next steps obviously involve trying out additional demos and – more usefully – inspecting the code behind these demos and first attempts at modifying and imitating them.

Kaazing ships with the sources for the demos and the libraries required to run them:

Image

Resources

About Kaazing and WebSockets: http://tech.kaazing.com/documentation/html5/kaazing-websocket-html5.html

Kaazing Set Up Guide: http://tech.kaazing.com/documentation/html5/setup-guide.html

Downloading Kaazing HTML 5 Edition: http://kaazing.com/download

Share.

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PLSQL), Service Oriented Architecture, BPM, ADF, Java in various shapes and forms and many other things. Author of the Oracle Press book: Oracle SOA Suite 11g Handbook. Frequent presenter on conferences such as JavaOne, Oracle OpenWorld, ODTUG Kaleidoscope, Devoxx and OBUG. Presenter for Oracle University Celebrity specials.

2 Comments

  1. Thank you for the thoughtful review. The main advantage of html5 seems to be for embedding rich media such as audio and video in modern browsers. Although, the structure elements seem to be useful. CSS3 seems to be headed in the right direction, leaving many possibilities for implementation and creativity,

  2. Pingback: First steps with jWebSocket – open source Java framework for WebSockets – installation and running samples « AMIS Technology blog

Leave a Reply