murnax / rabbitmq-with-expressjs

An example of how to use amqp protocol from rabbitmq to run on REST API on express.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rabbitmq-with-expressjs

By following tutorials from RabbitMQ official site. There is a problem for me to adapt the code from tutorials and use it in my project, since most examples not running on long-lived process.

After googling for a pattern I could use, I ended up found this great article

So here I will use pattern I found from the article along with express.js to create producer, and use this tutorial to create consumer.

Prerequisite

  • node & npm
  • rabbitmq

Installation

npm install

Start RabbitMQ server

rabbitmq-server

Start application

# first terminal
node app.js

# second terminal
node rpcServer.js

Then navigate to "localhost:3000/fibonacci/15" and you will see the result.

About

An example of how to use amqp protocol from rabbitmq to run on REST API on express.js


Languages

Language:JavaScript 100.0%