These examples cover the most common implementation models with RabbitMQ.
- Workers
- Publish / Subscribe
- RPC
You need Node.jsand you will need a running RabbitMQ server.
For these examples you will have to clone the project and install the amqplib package
cloning the project
git clone https://github.com/henriqueViana/nodejs-rabbitmq-examples.git
install dependencies
npm i -S amqplib
OR
yarn add amqplib
Callback Example:
node src/workers/callback/publisher.js
node src/workers/callback/worker.js
Promise Example:
node src/workers/promise/publisher.js
node src/workers/promise/worker.js
Callback Example:
node src/pubsub/callback/publisher.js
node src/pubsub/callback/worker.js
Promise Example:
node src/pubsub/promise/publisher.js
node src/pubsub/promise/worker.js