It is not a websocket issue it is a design issue. Either the notification 
service needs to subscribe to the MQ channel for each user logged into that 
service, or it needs to subscribe for a group of users, or all users. 

Sounds like you are doing all users, and it is not working but you don’t say 
exactly how it is failing. 

The easiest is to partition the NS by group, then during login assign the user 
to a NS group. 

You could also use an intermediate service that listens to MQ and knows the 
which NS server is handling which user and sends directed messages to that NS 
server... that way only the intermediate service needs to handle all messages.  

You need to understand why it fails or expected failures before you continue...

> On Nov 30, 2018, at 2:17 AM, GolangUser <explorehorizon...@gmail.com> wrote:
> 
> Hi,
> 
> The scenario is, a web socket connection is being created to server side 
> application say NotificationService whenever a user login to our website. The 
> NotificationService has been deployed on 5 instances.
> 
> The event driven service filters the incoming events and broadcast the 
> processed user specific messages over RabbitMQ to NotificationService. 
> Further, each deployed NotificationService receives the messages from 
> RabbitMQ and check for the active user websocket connection. If it finds the 
> connection then push the message over socket else drops the message.
> 
> In above scenario, with growing user base, we are replication the message on 
> each queue connected to the NotificationService. Hence, the system is not 
> properly scaled. Can I direct the user specific messages to where user has 
> made active WebSocket connection? User can login through desktop, mobile, 
> native application. So, expected that web socket connection being established 
> on more that one NotificationService instances.
> 
> How do I direct the traffic?
> 
> Thanks in advance.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to