为什么我们需要使用rabbitmq

编程入门 行业动态 更新时间:2024-10-28 06:21:12
本文介绍了为什么我们需要使用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

本文发布于:2023-06-08 02:59:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/572850.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:rabbitmq

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!