[rabbitmq-discuss] Stuck waiting for frame during amqp_basic_qos?

Pieter de Zwart pdezwart at rubiconproject.com
Tue Nov 8 02:35:50 GMT 2011

Hey everyone,

I am doing something wrong, and I could use some help.  I maintain/develop the PHP extension that interfaces with RabbitMQ via the rabbitmq-c library. We have implemented all of the low level calls, but have also added some helpful wrappers to let poor PHP users not have to deal with all the complexity of the protocol. One of these wrapper methods is AMQPQueue::getMessages(). Unfortunately, I have built a bug I don’t know how to squash.
During the second call to the AMQPQueue::getMessages() function within a loop (reusing connection and channel), the process get stuck in busy wait. In the attached file on line 37, we call amqp_basic_qos() to prevent any prefetching by the server. That call goes through the following stack in rabbitmq-c:

librabbitmq/amqp_framing.c:1999: amqp_basic_qos
librabbitmq/amqp_socket.c:356: amqp_simple_rpc_decoded
librabbitmq/amqp_socket.c:264: amqp_simple_rpc
librabbitmq/amqp_socket.c:157: wait_frame_inner

And then it gets stuck in that while(1) loop. This is where I am a n00b. I was wondering if someone would be so kind as to review the attached code to see if there is anything obviously stupid I am doing before I go into writing an example in C to highlight my stupidity.

Any help would be much appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111107/d61b24cb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amqp_getmessages.c
Type: application/octet-stream
Size: 8021 bytes
Desc: amqp_getmessages.c
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111107/d61b24cb/attachment.obj>

More information about the rabbitmq-discuss mailing list