markodayan / ipc-rabbit

A demo of asynchronous inter-process communication between different node.js services using RabbitMQ messaging. Easy Docker setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Asynchronous Service Communication via RabbitMQ

Facilitate distributed system state transitions via RabbitMQ messaging

We have 3 services named foo, bar, and baz. We would like to spin them up in a specific order to mimic inter-service dependency, the order is depicted below

foo -> bar -> baz

  • We will make use of RabbitMQ and message queues to manage inter-process communication.
  • We will run the services (foo, bar, baz) using the PM2 process manager.
    • Each service is running its own express server.
  • We will make use of Docker Compose to spin up a RabbitMQ server container as well as an application container to host our 3 services.

Running the project will yield the simple outcome above, where the express apps start in the correct logical order guided by asynchronous IPC. This is just a demo of basic functionality of asynchronous messaging.

To test it out, install the dependencies, make sure you have Docker, then simply run:

npm run compose

About

A demo of asynchronous inter-process communication between different node.js services using RabbitMQ messaging. Easy Docker setup


Languages

Language:TypeScript 91.7%Language:JavaScript 8.0%Language:Shell 0.2%