Streaming social events with STOMP over SockJS

In this recipe, we broadcast user activities (events) with STOMP over SockJS. SockJS provides a custom implementation of WebSocket.

Getting ready

There is some configuration work to be done beforehand, especially on the Apache HTTP proxy. After that, we will see how to initiate a WebSocket with SockJS and with AngularJS on the client side.

Our WebSocket will subscribe to a topic (for broadcasting) published via Spring from the cloudstreetmarket-api module.

How to do it…

  1. From the Git Perspective in Eclipse, checkout the latest version of the branch v8.1.x.
  2. Run the Maven clean and Maven install commands on the zipcloud-parent project (right-click on the project, select Run as… | Maven Clean, then select ...

Get Spring MVC: Designing Real-World Web Applications 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.