Sorin Vladu
Sorin Vladu

Reputation: 1788

Websocket support in a web application

I want to develop a web application using websocket.

I have found two solutions for this task:

Using Spring websocket (included in Spring 4) - I am already familiarized with Spring

Using Atmosphere framework - I've read the docs, it seems to be a mature framework.

I want from the websocket framework to provide a fallback-support in case when the browser isn't HTML5 compliant, also, I need a client-library for android.

I see that Atmosphere provides support for Socket.IO library, which I want to use on browser client side. I see that Spring websocket provides only SockJS support over STOMP.

Can I use the same library, Socket.IO, in Spring websocket?

Do you recommend me to use Atmosphere + Spring (for building the RESTFul API) in the same project?

Thank you

Upvotes: 0

Views: 847

Answers (1)

Sergi Almar
Sergi Almar

Reputation: 8414

I would suggest going for the WebSocket support in Spring. If you are already using Spring, this will give you a similar programming model plus all these features:

  • Fallback options with SockJS
  • Subprotocol support with STOMP
  • Integration with full blown STOMP broker (like RabbitMQ)
  • HttpSession and WebSocket Session sync (using Spring Session)
  • WebSocket security (in the upcoming Spring Security 4)
  • SockJS Java client (for application to application communication and performance testing, haven't tried it on Android yet but might work)
  • Runtime Monitoring
  • Active community with fast response times to requests

The WebSocket support has been around since Spring 4, tested and refined for over a year now. A production ready solution which I'm using in my projects.

Upvotes: 4

Related Questions