Solution:
You will need to create a back-end server for your front-end Vue js app / React js / Android app …etc , below is a simple graph that explains how you can consume your RabbitMQ messages using NodeSrv
(a node js web server) , notice that you will need 2 queues , Qa
for write , and Qb
for read , whenever you send a ws request, your NodeSrv
will send data to the queue Qa
(I did not explain how data is sent to Qb
, I assume there will be some other consumers that will consume Qa
and send their result to Qb
) and then Qb
will be consumed by NodeSrv
again and sent back to front end via websocket.
Note1 : when Qb will be consumed by many consumers (NodeSrv) , RabbitMQ will balance the load to those consumers using Round Robin algorithm ( message is forwarded to each consumer in turn )
Note2 : since you can have many consumers , it would be nice to add a load balancer like haproxy or simply pm2 as a load balancer for the client side