8 May 2014

Websockets: How to use it in order to get real time data in a web browser


  • Advance
The main idea with this project is just learning how to achieve the effect of real time data appearing in the web browser, without need of refreshing the web browser.

How does it achieved? Using websockets technology, spring framework and rabbitmq broker message with stomp support and with a bit of html5 and Jquery.

  • Explanation


The example project is based in knowing where the buses of Dublin city are in every moment. Luckily Dublin city has every bus connected to internet, so every customer can connect to internet during the trip, and also every bus is connected to a system to send their position to the system.

That system is available using a REST api provided by Dublin city, so, where is the trick? The trick is you need to ask periodically to the system about new data, enqueue the data to the rabbitmq-stomp broker message and with a bit of jquery code the effect is done.

  • Conclusions
I think the code is self-explainable, so you can download it and get the conclusions for your own. Enjoy!

  • About the author:
This post is a contribution made by Alonso Isidoro Román, a Software Engineer from Badajoz (Spain). You can follow or contact with Alonso Isidoro Román through these social networks:



No comments:

Post a Comment