<div dir="ltr">Thank you very much for your answer. I need some complementary information to deal with my problem.<div>Here is the problem:</div><div>Suppose you start to consume (amqp_basic_consume) and loop over the frames when a exception is thrown and you exit the loop.</div><div><br></div><div>Remaining messages in the queue are consumed but not examined anymore :</div><div><br></div><div>- is there a way to find these "lost" messages ?</div><div><br></div><div>Won't it be safer to get one, handle it, catch exceptions if any and then move to the other one ?<br></div><div><br></div><div>- if yes, does "get" method consume the message as well ?</div><div><br></div><div>Thank you all for your help,</div><div><br></div><div>William</div><div><br></div><div><br></div><div><br>Le mardi 13 mars 2012 18:44:38 UTC+1, Alan Antonuk a écrit :<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">basic.get is synchronous call which the client asks the broker: "are there any messages in this queue, if so please give me one".<div><br></div><div>basic.consume is a synchronous call that starts an asynchronous behavior: it tells the broker, "please deliver to me the messages in this queue until I say stop". The messages can then arrive from the broker at any point in the future.</div>
<div><br></div><div>The rabbitmq-c library does have a function to do basic.get (amqp_basic_get). The rabbitmq-c also has a function to start and stop a consumer (amqp_basic_consume and amqp_basic_cancel). However it does not have an API to deal with consuming messages. You will need to loop examining amqp frames as they come in and decide how to piece them together as their delivered (check the amqp_consumer.c example for details). </div>
<div><br></div><div>-Alan<br><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 12:40 PM, Jacques du Rand <span dir="ltr"><<a href="javascript:" target="_blank" gdf-obfuscated-mailto="uDmpaWeztFUJ">jacq...@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Hi guys. <br>
I recently learnd that the c library when using basic get is also blocking. In php its non blocking. What then is the difference between basicget and consume? At a c lib level? <br>
Regards<span><font color="#888888"><br>
Jacques</font></span></p>
<br>______________________________<wbr>_________________<br>
rabbitmq-discuss mailing list<br>
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="uDmpaWeztFUJ">rabbitmq...@lists.<wbr>rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/<wbr>cgi-bin/mailman/listinfo/<wbr>rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div>