AMQP 如何克服直接使用 TCP 的困难? [英] How does AMQP overcome the difficulties of using TCP directly?

查看:28
本文介绍了AMQP 如何克服直接使用 TCP 的困难?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AMQP如何克服发送消息时直接使用TCP的困难?或者更具体地说是在发布/订阅场景中?

How does AMQP overcome the difficulties of using TCP directly when sending messages? Or more specifically in a pub/sub scenario?

推荐答案

在 AMQP 中有一个代理,该代理接收消息,然后完成将它们路由到交换和队列的困难部分.您还可以设置持久队列,即使客户端断开连接,也可以为客户端保存消息.

In AMQP there is a broker, that broker receives the messages and then does the hard part about routing them to exchanges and queues. You can also setup durable queues which save the messages for clients even when they are disconnected.

您当然可以自己完成所有这些工作,但要正确完成这些工作量很大.尤其是 RabbitMQ,已经在许多部署中进行了实战测试.

You could certainly do all this yourself, but it's a tremendous amount of work to do correctly. RabbitMQ in particular has been battle tested in many deployments.

你还在使用 AMQP 下的 TCP 协议,AMQP 提供了更高的抽象.

You are still using the TCP protocol underneath AMQP, AMQP provides a higher abstraction.

您还必须选择用于所有客户端的有线协议,其中 AMQP 已经定义了该有线协议.

You would also have to choose a wire protocol to use with all your clients, where AMQP already defines that wired protocol.

这篇关于AMQP 如何克服直接使用 TCP 的困难?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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