为什么 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 --> 告诉代理客户端想要发布消息

Content Frame ---> 告诉代理有关消息的详细信息,例如大小。

一个或多个 Body Frames --> 这包含实际数据。

我可以理解为什么 rabbitmq 客户端可能需要发送多个正文帧,因为数据可能太大而无法在单个帧内发送。但是有一个单独的方法内容框架有什么目的呢?为什么客户端不只是将它与第一个正文帧一起发送,或者只是同时发送方法内容帧?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)