【发布时间】:2013-12-19 02:40:14
【问题描述】:
RPC 调用和强制转换是 OpenStack 中两种不同类型的消息传递协议。在 RPC.call 的情况下,调用者(或调用者)等待来自工作人员(被调用者)的回复或确认消息。
我正在尝试拦截通过 OpenStack 中的 rabbitmq 系统的所有 RPC 消息(请求和回复消息)。在 OpenStack 中,所有请求消息都通过一个名为“nova”的交换器。将新队列附加到“nova”交换,我可以捕获请求消息。
现在,我想捕获发送回被调用者的回复消息。回复消息可以被AMQP and Nova指定的“直接消费者”捕获,摘录如下
a Direct Consumer comes to life if (an only if) a rpc.call operation is executed; this object is
instantiated and used to receive a response message from the queuing system; Every consumer connects to
a unique direct-based exchange via a unique exclusive queue; its life-cycle is limited to the message
delivery; the exchange and queue identifiers are determined by a *UUID generator*, and are marshaled in
the message sent by the Topic Publisher (only rpc.call operations).
为了捕获回复消息,我尝试连接到具有相应 msg_id 或 request_id 的直接交换。我不确定捕获特定 rpc.call 回复的正确交换 ID 是什么。
知道我可以用来从 rpc.call 消息中捕获回复的交换 id 是什么吗?我附上的摘录中指定的 UUID 生成器是什么?
【问题讨论】: