[rabbitmq-discuss] Simple C Client to read from a Queue

Sajith Kariyawasam sajhak at gmail.com
Thu Sep 6 12:44:35 BST 2012

Hi Tim,

Thanks for the reply and sorry for the inconvenience if I have put the
message into a "wrong" thread.

Even before putting the mail I tried commenting out the loops, but still I
saw it does wait until a message is available in Queue.

Also, I found
http://rabbitmq.1065348.n5.nabble.com/Librabbitmq-c-API-td6134.html , that
they have referred to "amqp_basic_get", and was thinking that someone will
give some help in using amqp_basic_get. I couldn't find a reference
document for C API, but there are docs available for Java/Erlang..etc.. but
could not find any for C.  "amqp_basic_get" have not been used in the set
of example as well...

Actually I'm not a C developer, but a Java Developer, and my requirement is
bit urgent, that's why I was expecting such kind of a basic help. If I had
time, definitely I would have go through the code n will try to understand

IMO, it would have been better If the documentation related to C libraries
are bit improved, so that it will be easy for new comers to understand..

On Thu, Sep 6, 2012 at 4:41 PM, Tim Watson <tim at rabbitmq.com> wrote:

> On 6 Sep 2012, at 12:03, Tim Watson wrote:
> On 6 Sep 2012, at 11:39, Sajith Kariyawasam wrote:
> Hi all,
> My requirement is to read a message from an AMQP based broker queue, using
> a C Client.
> I tested the samples found in https://github.com/alanxz/rabbitmq-c<http://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Falanxz%2Frabbitmq-c&sa=D&sntz=1&usg=AFQjCNEMwRO8OLSNeNdnSc0ZrkktMhO50A>,
> there I'm more interested in amqp_listenq.c programme.
> But my requirement is to run this client periodically, should not
> continuously listen to the message queue (as in this example). I need to
> read just a simple message and out put the text content of that message.
> Someone pointed out that you're after basic.get though. If you are *just*
> trying to pull 1 message off the queue and then terminate the program, then
> just drop the loops.
> Does amqp_consumer.c not do more of what you're interested in?
> No, the listenq.c sample is the one you want. It really does seem that
> you're trying to get someone to write your C code for you though - as I
> said, just remove the looping - and whilst we are very keen to help with
> rabbit questions, I suspect this might be going a bit far even for the more
> enthusiastic among us. ;)
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120906/712436e6/attachment.htm>

More information about the rabbitmq-discuss mailing list