有关消息传递/消息队列的经验法则 [英] Rules of thumb regarding Messaging / Message Queueing

查看:75
本文介绍了有关消息传递/消息队列的经验法则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以提供一些有关何时使用消息队列以及应该解决的实际现实问题的经验法则吗?

Can someone provide some rules of thumb regarding when to use Message Queueing and what practical real-world problems they are supposed to address?

谢谢

推荐答案

异步消息传递允许系统以断开连接的方式进行通信.不必同时使用两个系统来完成工作.

Asynchronous messaging allows systems to communicate in a disconnected manner. It is not necessary for both systems to be available simultaneously for work to get done.

还有其他好处.消息传递通常提供一种(有时是无意的)限制机制.这样可以避免接收系统同时出现许多请求时变得不知所措.

There are other benefits as well. Often messaging provides a (sometimes unintentional) throttling mechanism. This keeps the receiving system from becoming overwhelmed should many requests all come in simultaneously.

许多消息传递系统还提供了持久性和可靠性功能,即使消息传递平台或接收系统崩溃,也可以保证最终将传递消息.

Many messaging systems also provide persistence and reliability facilities, a guarantee that the message will eventually be delivered, even if the messaging platform or receiving system crash.

消息队列还提供了一个间接层.将消息放入队列的系统不一定知道谁在接收消息.接收方可以以微妙或剧烈的方式更改,而根本不影响发送方.通常需要这样的松耦合.

Message queues also provide a layer of indirection. The system that places a message on a queue does not necessarily know who, if anyone, is receiving the message. The receiver could change in subtle or drastic ways without affecting the sender at all. Loose coupling like this is usually desirable.

许多消息传递解决方案也可以参与交易.这样可以确保系统既可以接收消息,也可以更新数据库以作为响应,并且知道这两者都不成功.如有必要,可以回滚"邮件的接收,并在出现问题时重试.

Many messaging solutions can participate in transactions as well. This ensures that a system can both receive a message and update a database in response, and know that either both or neither succeeded. If necessary, the receipt of the message can be "rolled back" and retried if a problem occurs.

这篇关于有关消息传递/消息队列的经验法则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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