![The Backend Engineering Show with Hussein Nasser artwork](https://is1-ssl.mzstatic.com/image/thumb/Podcasts113/v4/cd/d5/bb/cdd5bbe4-0e12-9615-1bd5-6f578f2e6875/mza_5436295260688338257.jpg/100x100bb.jpg)
Episode 109 - RabbitMQ
The Backend Engineering Show with Hussein Nasser
English - November 03, 2019 20:28 - 42 minutes - 24.5 MB - ★★★★★ - 5 ratingsTechnology Homepage Download Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed
RabbitMQ
RabbitMQ is an open source distributed message queue written in Erlang and supports many communication protocols. It was trying to solve the spaghetti 🍝 mesh architecture where every client is communicating with other client in System by introducing an extra layer in the middle.
(slide)
In this video we will explain basic components of RabbitMQ Such as AMQP, channel, queue, publisher, consumer and some stuff, we will also learn how to spin up a RabbitMQ server and we will finally write some code to develop a publisher client that post messages to RabbitMQ. We will also write the consumer piece which will be the code that reads rabbitMQ. Finally I will talk about my personal thoughts on this tech.
RabbitMQ Components(slide)
*Publisher
*Consumer
*Connection
*Channel
*Queue
Spin RabbitMQ server with Docker
Write a Publisher client NodeJs
Write a Consumer client Nodejs
My Thoughts about this tech
Summary
timecodes
components 2:00
spin up docker rabbit 8:30
Write a Publisher client NodeJs 11:00
Write a consumer client NodeJs 20:30
my thoughts 33:50
Source Code: https://github.com/hnasr/javascript_playground/tree/master/rabbitmq
Example
Schedule async job
Exchange
Queues
Publisher
Consumer
AMQP
Channel
Connection
HTTP
AMQP
Uses Channels and Queues
Multiples channels into one connections
docker run --name rabbitmq -p 5672:5672 -d rabbitmq
docker run --name rabbitmq -p 5672:5672 -p 15672:15672 -d rabbitmq:3-management
HTTP
fetch("http://localhost:15672/api/vhosts”, {headers: {"Authorization" : `Basic ${btoa('guest:guest')}`}}).then(a=>a.json()).then(console.log)
fetch("http://localhost:15672/api/channels", {headers: {"Authorization" : `Basic ${btoa('guest:guest')}`}}).then(a=>a.json()).then(console.log)
fetch("http://localhost:15672/api/queues", {headers: {"Authorization" : `Basic ${btoa('guest:guest')}`}}).then(a=>a.json()).then(console.log)
https://www.squaremobius.net/amqp.node/channel_api.html#channel_bindExchange
https://www.rabbitmq.com/tutorials/tutorial-three-javascript.html