WebSocket in JBoss EAP 6.3 (Tech Tip #23)

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 ?

 

Be Sociable, Share!
  • Tweet
  1. Krutik says:

    Hi Arun,

    I have seen your session on websocket over InfoQ. I have questions regarding persisting the peers onOpen connection in Set.

    do we required to persist peers in memory?
    can’t we have mechanism in websocket endpoint it can identify it self to communicate with the client?

    Thanks.

  2. Krutik says:

    If this is required to persist in to the memory then how it will work with distributed cloud environment?

  3. David says:

    How could you have tried the canonical chat sample on EAP 6.3 when it is EE6 but the sample is an EE7 example?

  4. arungupta says:

    David,

    JBoss EAP 6.3 has added a technology preview for JSR 356/WebSocket and that’s where this feature is coming from. Hope that clarifies.

  5. David Jensen says:

    Yes, that helps, thanks. However, inside the pom.xml file, it references EE7:

    javax
    javaee-api
    7.0
    provided

    What should I do in my pom.xml for EAP 6.3 (which uses EE6)?

  6. arungupta says:

    Yeah, its only provided and so not packaged in the archive.

  7. Dieting Johannesburg says:

    Great blog! Do you have any helpful hints for aspiring
    writers? I’m hoping to start my own blog soon but I’m a little
    lost on everything. Would you suggest starting with
    a free platform like WordPress or go for a paid option? There are so many choices out there that I’m completely overwhelmed ..
    Any ideas? Many thanks!

    Visit my web-site – Dieting Johannesburg

  8. mark says:

    any idea why this was left as a tech preview/unsupported feature for EAP 6.3?

  9. arungupta says:

    Mark,

    Could not complete TCK compliance in time before the release, otherwise would’ve been a supported feature.

Leave a Reply

Your email address will not be published. Required fields are marked *


eight − = 2

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>