The application shows the communication via the message queue
between the console client application and the console subscriber in Node.js
.
Redis
was used as a message broker
between two applications.
Client application reads the entered characters from the console and sends them to the Redis buffer.
The subscriber receives these messages and saves them to a file.
If the client issues the "clear" command, the content of the subscribing application's file will be cleared.
The application end with the "close" command. You can also close the program with the SIGINT
(^ C) event
Requirements
- redis 6.0.9
- Node.js >= v14.15.1
- npm >= 7.5.4
cd ./subscriber
npm i
npm start:dev
cd ./client
npm i
npm start:dev
docker-compose up -d
cd ./client
npm i
npm start:dev