PubSub Messaging Over Websocket.
_______ ______ _______ ______
|\ /|( ____ \( ___ \ ( ____ \|\ /|( ___ \
| ) ( || ( \/| ( ) )| ( \/| ) ( || ( ) )
| | _ | || (__ | (__/ / | (_____ | | | || (__/ /
| |( )| || __) | __ ( (_____ )| | | || __ (
| || || || ( | ( \ \ ) || | | || ( \ \
| () () || (____/\| )___) )/\____) || (___) || )___) )
(_______)(_______/|/ \___/ \_______)(_______)|/ \___/
Easily make a real time communication core between your users and your microservices through web socket with power of
redis or nats.
Simply run docker-compose -f ./test/docker-compose.yaml up
. It will set up a redis instance and a websub instance
that listens to port 8379.
In browser go to the websub_sample form
and start a websocket connection by clicking on “open” button. It will create a websocket connection to websub and
websub will create subscriptions to topics “johntopic1” and “johntopic2”
for the user.
Now you can send messages to your client through redis:
docker-compose -f ./test/docker-compose.yaml exec redis /bin/sh -c "redis-cli publish johntopic1 hello-john"
docker-compose -f ./test/docker-compose.yaml exec redis /bin/sh -c "redis-cli publish johntopic2 hello-john"