The purpose of this repository is to show an example about how to use RabbitMQ with NodeJS. With RabbitMQ, we can send a message through publisher and subscriber wil receive it. In the case of this example, I used the message Hello World!
- Make sure you have docker or podman or another container program.
- Run the command to initialize the rabbitMQ service. Example with Docker:
docker compose up- Install dependencies with npm, pnpm, yarn or another package manager of your choice. Example with pnpm:
pnpm i- Initialize publisher and subscriber. Example:
pnpm run publisher
pnpm run subscriber- Subscriber should receive Hello World as output.