Chapter 8. Adding WebSockets

WebSockets are one of the biggest additions in Java EE 7. In this chapter, we will explore the new possibilities that they provide to a developer. In our ticket booking applications, we already used a wide variety of approaches to inform the clients about events occurring on the server side. These include the following:

  • JSF polling
  • Java Messaging Service (JMS) messages
  • REST requests
  • Remote EJB requests

All of them, besides JMS, were based on the assumption that the client will be responsible for asking the server about the state of the application. In some cases, such as checking whether someone else has not booked a ticket during our interaction with the application, this is a wasteful strategy; the server is in the position ...

Get Java EE 7 Development with WildFly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.