rabbitmq - 为什么 RabbitMQ 客户端在将实际消息体发送到 RabbitMQ 代理之前发送一个方法帧和一个内容帧?
问题描述
我正在阅读这本书“RabbitMQ in Depth”,它描述了每当客户端想要发布消息时客户端如何与代理进行通信。它说从客户端到代理至少进行了 3 次 RPC 调用:
When publishing messages to RabbitMQ, multiple frames encapsulate the message data that’s
sent to the server. Before the actual message content ever reaches RabbitMQ, the client
application sends a Basic.Publish method frame, a content header frame, and at least one
body frame
When RabbitMQ receives all of the frames for a message, it will inspect the information
it needs from the method frame before determining the next steps.
Method Frame --> 告诉代理客户端想要发布消息
内容框架 ---> 告诉代理有关消息的详细信息,例如大小。
一个或多个 Body Frames --> 这包含实际数据。
我可以理解为什么 rabbitmq 客户端可能需要发送多个正文帧,因为数据可能太大而无法在单个帧中发送。但是有一个单独的方法和内容框架有什么用呢?为什么客户端不只是将它与第一个主体框架一起发送,或者只是同时发送方法和内容框架?
解决方案
推荐阅读
- r - 如何摆脱 R 中具有相同名称的多个列?
- r - 生成一个 for 循环,该循环将制作绘图并为它们提供正确的标题
- pandas - 时间序列指数 Pandas 系列 - 如何屏蔽范围
- reactjs - 提交表单后如何在 React.js 中更新 DOM
- java - 如何从 MySQL 将确切的行数加载到 jTable 并对剩余的行进行分页?
- python - 简单的 SFTP 脚本
- javascript - PHP动态列表检索返回未定义索引
- scala - Lisp 宏和 scala 宏有什么区别?
- ruby-on-rails - 如何在 ActiveRecord 中的客户表中获取最受欢迎的邮政编码?
- perl - 为什么在生成守护进程时会剥离 utf8 IO 层?