Redis Pubsub in action
Basic impletmentation of Redis Pubsub
Run Locally
Clone the project
git clone git@github.com:quocthinhle/redis-pubsub.git
Go to the project directory
cd redis-pubsub
Install dependencies
npm install
Install pm2
npm install -g pm2
Start the server with 4 instances (pm2 cluster mode)
pm2 start ecosystem.config.js
Incase you haven't install redis yet
docker container run --publish 6379:6379 --detach redis
Test the "pubsub"
curl -X POST http://localhost:3000/api/publish -H "Content-Type: application/json" -d '{"message": "Your message"}'
Result will be shown in
pm2 logs