vendredi 30 janvier 2015

Handling Spring Boot Clustered Websockets on Amazon Beanstalk

I have an application using Spring Framework / Spring Boot / Spring Messaging/Websockets and am going to be deploying it to Elastic Beanstalk. You can think of the application as a chat application (it actually does have chat features)


Scenario


Here is an example scenario:



Client A <-> Server A
Client B <-> Server B
Client C <-> Server B


Now, if Client A posts a message, using spring messaging, if I send that message to all connected clients, only Client A will see it because only Client A is connected to Server A, and likewise if Client B does, only Clients B and C will see it, not Client A.


So this leaves me with a problem of what options I have.


Possible Solutions


If possible, I would like to use an Amazon service as I am already in their cloud platform.


I thought about using Amazon SQS, having each server subscribe to the same queue, and then sending all notifications through it, but I believe all requests with SQS are active, so I would have to do polling, and would create a significant delay.


Does anyone know of a good solution for this problem? I can set up a server to handle all web-sockets, but that is not optimal.


Thanks in advance!





Aucun commentaire:

Enregistrer un commentaire