Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need to use rabbitmq

Why do we need RabbitMQ when we have a more powerful network framework in Python called Twisted. I am trying to understand the reason why someone would want to use RabbitMQ.

Could you please provide a scenario or an example using RabbitMQ?

Also, where can I find a tutorial on how to use RabbitMQ?

like image 762
fear_matrix Avatar asked Feb 27 '11 10:02

fear_matrix


People also ask

Why should we use RabbitMQ?

RabbitMQ is a messaging broker - an intermediary for messaging. It gives your applications a common platform to send and receive messages, and your messages a safe place to live until received.

Why do we need message broker?

A message broker is an intermediary where all messages send through. Thereby we achieve an additional decoupling between transmitter and receiver. A sender sends a message to the message broker, and the message broker will pass it on to the recipient.

Why do we need message queue?

Message queues provide communication and coordination for these distributed applications. Message queues can significantly simplify coding of decoupled applications, while improving performance, reliability and scalability. You can also combine message queues with Pub/Sub messaging in a fanout design pattern.

What is RabbitMQ and how does it work?

RabbitMQ is an open source message broker software. It accepts messages from producers, and delivers them to consumers. It acts like a middleman which can be used to reduce loads and delivery times taken by web application servers.


1 Answers

Let me tell you a few reasons that makes using MOM (Message Oriented Middleware) probably the best choice.

Decoupling:

It can decouple/separate the core components of the application. There is no need to bring all the benefits of the decoupled architecture here. I just want to point it out that this is one of the main requirement of writing a quality and maintainable software.

Flexibility:

It is actually very easy to connect two totally different applications written on different languages together by using AMQP protocol. These application will talk to each other by the help of a "translator" which is MOM.

Scalability:

By using MOM we can scale the system horizontally. One message producer can transmit to unlimited number of message consumers a task, a command or a message for processing and for scaling this system all we need to do is just create new message consumers. Lets say we are getting 1000 pictures per second and we must resize them. Solving this problem with traditional methods could be a headache. With MOM we can transmit images to the message consumers which can do their job asynchronously and make sure data integrity is intact.

They are other benefits of using MOM as well but these 3 are the most significant in my opinion.

like image 120
hserge Avatar answered Sep 17 '22 13:09

hserge