18 September 2012

WebSockets on WebLogic Server

We've been busy working on putting in support for the WebSocket Protocol into WebLogic Server with the intent to include it in the next major release (usual caveats apply with respect to dates, times, features, etc.).  Running the Autobahn WS Testsuite, which seems to be the industry defacto WebSocket compatibility verifier, we are seeing reports with very high levels of compatibility.

As there's no standard WebSocket Java API at this point, we've chosen to model the API on the Grizzly WebSocket API with some minor changes where necessary.  Once the results of JSR-356 (Java API for WebSocket) becomes public, we'll look to implement and support that.

In the background we have also done some integration work with the earlier WebSocket-SDK that was being used as a vehicle for WebSocket API investigations in order to try it out and look at the SPI requirements -- but we won't expose it in WLS 12.1.2 and will wait for the formal Java API for WebSocket to be finalized.

Back to WLS 12.1.2 and it's WebSocket API, as an exercise, I just ported the Apache Tomcat WebSocket demo called snake to run on WLS.

The original Tomcat demo source is here:

http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/snake/
 
Here it is running on a development build of WebLogic Server 12.1.2.


There are some differences in terms of handling of connections and the registration approach but it was a pretty straight forward exercise and took about 30 minutes.  The demo didn't require too many major changes as the APIs are semantically similar in terms of accepting connections, handling messages and sending/broadcasting messages to clients.  Thankfully I didn't have to do anything on the client JavaScript side ... :-)

We also have the Grizzy/GlassFish Chat demo running on WLS as well.



 More info to come as we progress the documentation, etc.  Should be some demos of this running at OOW this year too I'd guess.


1 comment:

Anonymous said...

Hi Thanks for the info. If we have to implement server push with WLS 11g (10.3.6), what would you recommend? Use Pub-sub server? what will it take to migrate to 12c websockets later?