<div>Thanks for the clue, </div><div><br></div><div>I tried using it with following code, </div><div><br></div><div><div> die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");</div><div> conn = amqp_new_connection();</div>
<div> amqp_set_sockfd(conn, sockfd);</div><div> die_on_amqp_error(amqp_login(conn, "/", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "guest", "guest"),"Logging in");</div><div> if (!amqp_channel_open(conn, 1))</div>
<div> die_on_amqp_error(amqp_get_rpc_reply(conn), "opening channel");</div><div> reply = amqp_basic_get(conn,1,amqp_cstring_bytes(queuename),1);</div><div><br></div><div>I would like to verify whether the set of methods I have invoked and the order of invocation are correct ? </div>
<div><br></div><div><br></div><br><div class="gmail_quote">On Thu, Sep 6, 2012 at 4:53 PM, Tim Watson <span dir="ltr"><<a href="mailto:tim@rabbitmq.com" target="_blank">tim@rabbitmq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div class="im"><div>On 6 Sep 2012, at 12:11, Tim Watson wrote:</div><div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><font color="#000000"><br></font></div><div>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. ;)</div>
</div></div></blockquote><br></div></div><div>In fact looking at the sources for a couple of minutes now, you'll be better off using amqp_basic_get. I didn't notice that at first. There didn't seem to be an example of using that in the repository, so I now understand why you were struggling to see what to do. The returns a amqp_rpc_reply_t struct, from which you can probably get you want via the reply field.</div>
<div><br></div><div><pre><div><span>amqp_rpc_reply_t</span> <span>amqp_basic_get</span><span>(</span><span>amqp_connection_state_t</span> <span>state</span><span>,</span></div><div>                                <span>amqp_channel_t</span> <span>channel</span><span>,</span></div>
<div>                                <span>amqp_bytes_t</span> <span>queue</span><span>,</span></div><div>                                <span>amqp_boolean_t</span> <span>no_ack</span><span>)</span></div></pre></div><div><br></div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best Regards<div>Sajith</div><br>
</div>