Rabbitmq:envelop.message.body 和 envelop.message.pool 不同
Rabbitmq: different between envelop.message.body and envelop.message.pool
我有一个基于 nodejs
的制作人,我使用的 javascript 库是 amqp.node, and the consumer is implemented by C library。
从 rabbitmq 管理网站,我可以看到消息被推入队列并传递给消费者。在消费者中,amqp_consume_message
return AMQP-RESPONSE-NORMAL
,但是,envelop.message.body
为空。在这种情况下我该如何调试?
这是我使用来自 rabbitmq 的消息的代码
amqp_rpc_reply_t reply;
amqp_envelope_t envelope;
amqp_maybe_release_buffers(m_con);
timeval m_time;
m_time.tv_sec = dwMilliseconds/1000;
m_time.tv_usec = (dwMilliseconds%1000)*1000;
reply = amqp_consume_message(m_con, &envelope, &m_time, 0);//time out 1 second
if (AMQP_RESPONSE_NORMAL != reply.reply_type)
{
return false;
}
bool bRet = false;
amqp_bytes_t& rTheBody = envelope.message.body;
if (rTheBody.len > 0)
{
更新
经过进一步调查,我发现这些消息存储在 envelop.message.pool.pages
中。我想知道 message.body
和 message.pool
之间的区别?
引用 this
The pool field of the amqp_message_t
object (e.g.,
envelope.message.pool
) is a memory pool used for allocating parts of
the message. It is an implementation detail and should not be used by
client code directly (this implementation detail is subject to
change).
The only reason that the envelope.message.body.bytes
should be NULL
with a AMQP_RESPONSE_NORMAL
return value is if a 0-length message body
is received.
我有一个基于 nodejs
的制作人,我使用的 javascript 库是 amqp.node, and the consumer is implemented by C library。
从 rabbitmq 管理网站,我可以看到消息被推入队列并传递给消费者。在消费者中,amqp_consume_message
return AMQP-RESPONSE-NORMAL
,但是,envelop.message.body
为空。在这种情况下我该如何调试?
这是我使用来自 rabbitmq 的消息的代码
amqp_rpc_reply_t reply;
amqp_envelope_t envelope;
amqp_maybe_release_buffers(m_con);
timeval m_time;
m_time.tv_sec = dwMilliseconds/1000;
m_time.tv_usec = (dwMilliseconds%1000)*1000;
reply = amqp_consume_message(m_con, &envelope, &m_time, 0);//time out 1 second
if (AMQP_RESPONSE_NORMAL != reply.reply_type)
{
return false;
}
bool bRet = false;
amqp_bytes_t& rTheBody = envelope.message.body;
if (rTheBody.len > 0)
{
更新
经过进一步调查,我发现这些消息存储在 envelop.message.pool.pages
中。我想知道 message.body
和 message.pool
之间的区别?
引用 this
The pool field of the
amqp_message_t
object (e.g.,envelope.message.pool
) is a memory pool used for allocating parts of the message. It is an implementation detail and should not be used by client code directly (this implementation detail is subject to change).The only reason that the
envelope.message.body.bytes
should be NULL with aAMQP_RESPONSE_NORMAL
return value is if a 0-length message body is received.