Skip to main content

WebSocket in JBoss EAP 6.3 (Tech Tip #22)

Posted by arungupta on May 7, 2014 at 1:35 AM PDT

JBoss EAP (Enterprise Application Platform) is the commercially supported version of community supported JBoss AS 7.x. JBoss EAP 7 is scheduled to be released next year and will provide full compliance with Java EE 7. In the meanwhile, JBoss EAP 6.3 is getting ready to be released later this year.

Download JBoss EAP 6.3 Alpha, or this is also linked from the main downloads page.

A quick summary of JBoss EAP 6.3 is:

Features an updated administrative console that includes a new homepage and exposes the new JBoss EAP 6.2 patching features.  Also includes domain discovery and recovery improvements and support for WebSockets.

WebSocket ?

Yes, JBoss EAP 6.3 provides support for WebSocket using JSR 356 API. However this feature needs to be explicitly enabled by adding the following WEB-INF/jboss-web.xml to your .war file:

<jboss-web version="7.2" 
   xmlns="http://www.jboss.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee schema/jboss-web_7_2.xsd">
    <enable-websockets>true</enable-websockets>
</jboss-web>

A wide variety of WebSocket samples are available here. Try these samples on EAP 6.3 Alpha, and we are looking forward to your feedback.

I tried the canonical chat sample and the output from Chrome and Firefox looked like:

tip22-websocket-chat-eap6.3

Bug #1083038 provide more details on this feature.

Which WebSocket sample are you going to try ?