Clint Miller <clint at> writes:
I'm having a little trouble with the RabbitMQ-C library. I'm able to
declare exchanges, queues, setup bindings, and start the basic.consume
(amqp_simple_rpc function) method as I would expect.
You are calling the amqp_basic_*, amqp_queue_* and amqp_exchange_*
functions, right? amqp_simple_rpc is best thought of as an internal
function, and calling it directly should never be necessary these days.
None of the sample code in the tools/ and examples/ directories uses it.
But when a message is received by the consumer, I am able to observe
(via the debugger) the complete message (all the frames) being
processed. However, loop where multiple frames are linked together in
the amqp_simple_rpc function (labeled "retry:") never terminates, and
thus, at the end of what I think is a correct processing of all the
frames in the message, control goes back into the wait_frame_inner
function, where the recv function is called, anticipating more raw
data on the socket that isn't going to arrive.
amqp_simple_rpc doesn't process incoming messages. If it gets an
incoming frame that doesn't relate to the method, it stashes that frame
away for later handling, and waits for the next frame (as the reply
method frame should arrive sooner or later).

To consume messages via basic.get, use amqp_basic_get and then
amqp_simple_wait_frame to receive the body (see tools/get.c).

To consume messages via basic.consume, use amqp_basic_consume and then
call amqp_simple_wait_frame in a loop (see tools/consume.c and

David Wragg
Staff Engineer, RabbitMQ
VMware, Inc.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 10 | next ›
Discussion Overview
grouprabbitmq-discuss @
postedJul 20, '11 at 8:45p
activeJul 26, '11 at 3:32p

2 users in discussion

David Wragg: 5 posts Clint Miller: 5 posts



site design / logo © 2022 Grokbase