/nodejs-rabbitmq-examples

Examples of using RabbitMQ with NodeJS and its main implementations such as Workers, Pub / Sub and RPC

Primary LanguageJavaScriptMIT LicenseMIT

RabbitMQ with NodeJS examples · GitHub license

These examples cover the most common implementation models with RabbitMQ.

  • Workers
  • Publish / Subscribe
  • RPC

Requirements

You need Node.jsand you will need a running RabbitMQ server.

Quick Overview

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

Get Started

Workers

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

Publish / Subscribe

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