This is a simple project which simulate the process of multiple NSQ subscribers. The project is based on Express framework (NodeJs), and prepared with simple subscriber & publisher.
- Run the
nsqd
&nsqlookupd
daemon process on your machine (see: nsq.io) - Clone this project and run
npm i
ornpm install
to install module dependencies - Make copy of
.env.example
with a new name called.env
then configure the environment variables inside, for the nsqlookupd address(es). - Run the server by execute
npm run server1
to start server1 - Open new console/terminal then execute
npm run server2
to start server2 - Now you have 2 different running process, which is subscribed to
MESSAGE
topic in NSQ.
After you see both process server running on these 2 console/terminals, you can start simulation of publishing message by executing the script inside tool
folder.
>> node tool/publisher_simulator.js <NSQ_HOST> <NSQ_PORT_TCP>
This project is licensed under the MIT License - see the LICENSE file for details