Skip to content

gigouni/node-rabbitmq-amqp-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RabbitMQ + Node.js + JWT

This repository is used to assume the way RabbitMQ and Node.js could work together, around some AMQP protocol, without forgetting the JWT (JSON Web Token) authentication.

Hey, wanna know more? It's running with Docker!

Getting started

Open your terminal and clone the project stack from Github

$ git clone https://github.com/gigouni/node-amqp

Run the docker-compose.yml to docker-ise the bundles into a single 'virtual network'

$ cd node-amqp/bundles/ && sudo docker-compose up

Go check the bundles/README.md for more information

API endpoints

SENDER

  • POST /api/send/:data?token=TOKEN_KEY --> Send a message through the queue

RECEIVER MAIL

  • GET /api/receive?token=TOKEN_KEY --> Receive a message form the queue, for 'MAIL' target

RECEIVER SMS

  • GET /api/receive?token=TOKEN_KEY --> Receive a message form the queue, for 'SMS' target

Why RabbitMQ rather than ActiveMQ?

Why not? No seriously, there are some reasons. The first one is the popularity of the RabbitMQ MOM. The most the users, the more the potential help for future issues. The second one is the documentation much better w/ RabbitMQ than ActiveMQ.

"Well, and technically ?"

The POC is here to prove that RabbitMQ could easily, quickly be used as a MOM to handle the sending and receiving of messages. It's not so heavy content and benchmarks (here and here) are OK to tell that RabbitMQ is more efficient w/ light content. The AMQP ("Advanced Message Queuing Protocol") has been chosen due to the reliability of its queues and to be an example for most of the RabbitMQ/Node.js interested people (MQTT is better for IoT, STOMP for text-based messages and WS should be replaced by STOMP since the Javascript correctly handles JSON and text content).

Improvements

  • Implement an example of session ID authentication
  • Improve the stack with a better architecture and documentation (maybe)

Running the tests

Not implemented yet. Let's see it later

Deployment

Docker is part of the solution. Check this.

Built With

Contributing

No contributions necessary.

Authors

  • Nicolas GIGOU - Initial work - Gigouni

No other contributors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Implement a Node.js server
  • Follow ES6 conventions
  • Assume the role and the features of a MOM ("Message-Oriented Middleware")
  • Bind a Node.js server with a MOM like RabbitMQ
  • Control access through JWT
  • Dockerize the application w/ Dockerfile or docker-compose.yml

References

About

A POC using RabbitMQ as a message broker with AMQP (Advanced Message Queuing Protocol) and Node.js as a client

Resources

License

Stars

Watchers

Forks

Packages

No packages published