Transcript for:
RabbitMQ Overview

rabbit mq an open source distributed message broker that works like a post office in the cloud it was developed in 2007 and written in the erlang programming language which itself is famous for powering the open telecom platform in the beginning apps were built as monoliths with all concerns coupled together on a single runtime the problem is that not everything scales in parallel differing computational needs gave rise to the microservice architecture where every concern has its own run time that scales independently rabbitmq is a tool that allows these microservices to communicate asynchronously with a variety of different protocols for example you may have an app that applies deep learning photo filters when the user clicks a button that request goes to a rest api but instead of processing the image there it produces a message with the required data and publishes it to an exchange the exchange is then responsible for routing it to one or more queues which are linked to the exchange with a binding and routing key now the message sits in the queue until it's handled by the consumer which in this case would be the image processing server the exchange can route directly to a specific queue or to multiple cues with a shared pattern using topics or to every queue it knows about with fanout the end result is an architecture that allows servers to both publish and subscribe to data thanks to the rabbitmq middleman to get started install it or run it in a docker container on port 5672 it also contains a cli tool to manage and inspect your broker now create a file in your favorite server side language and bring in a library that implements a messaging protocol like advanced messaging queue protocol 091 this file will send a message and first needs to connect to rabbitmq on that connection we can use the create channel method to declare a cue which can be named whatever you want cues can be durable where the metadata is stored on disk or transient where it's only stored in memory and now produce a message by sending a buffer to that queue go ahead and run the file to create the queue and send the message then create another file to receive the message in real life this could be a different server on the other side of the world connect to rabbitmq just like we did for the publisher then reference the same queue name on that connection now use the consume method to receive a message and run a callback function with its data now run that file in a separate terminal to receive the message that's how a basic queue works but we could expand on this code by creating an exchange to manage multiple queues at the same time a fan out or topic exchange would allow multiple servers to subscribe to the same messages but consume them at different times this has been rabbitmq in 100 seconds hit the like button if you want to see more short videos like this thanks for watching and i will see you in the next one