为什么我们需要使用rabbitmq [英] Why do we need to use rabbitmq

查看:544
本文介绍了为什么我们需要使用rabbitmq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们在Python中有一个更强大的网络框架,称为Twisted,为什么我们需要RabbitMQ。我想了解有人想要使用RabbitMQ的原因。



请问您可以使用RabbitMQ提供场景或示例吗?



另外,在哪里可以找到教程关于如何使用RabbitMQ?

解决方案

让我告诉你一些使用MOM(面向消息的中间件)可能是最好的原因



去耦:



它可以解耦/分离应用程序的核心组件。没有必要在这里带来解耦架构的所有好处。我只想指出,这是编写质量和可维护软件的主要要求之一。



灵活性:



通过使用AMQP协议,将两种完全不同的应用程序连接在一起,实际上非常容易。这些应用程序将通过MOM的翻译器的帮助相互交流。



可扩展性:



通过使用MOM,我们可以水平扩展系统。一个消息生成器可以向无限数量的消息使用者发送任务,命令或用于处理和缩放该系统的消息,所有我们需要做的只是创建新的消息消费者。让我们说我们每秒得到1000张照片,我们必须调整大小。用传统方法解决这个问题可能会令人头疼。使用MOM,我们可以将图像传输到消息消费者,这些消息可以异步执行其工作,并确保数据完整性保持不变。



它们是使用MOM的其他好处,但是这些3是我认为最重要的。


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?

解决方案

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.

这篇关于为什么我们需要使用rabbitmq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆