[rabbitmq-discuss] Difference between get and consume.

William Weens william.weens at gmail.com
Thu Nov 14 20:14:04 GMT 2013


Thank you very much for your answer. I need some complementary information 
to deal with my problem.
Here is the problem:
Suppose you start to consume (amqp_basic_consume) and loop over the frames 
when a exception is thrown and you exit the loop.

Remaining messages in the queue are consumed but not examined anymore :

- is there a way to find these "lost" messages ?

Won't it be safer to get one, handle it, catch exceptions if any and then 
move to the other one ?

- if yes, does "get" method consume the message as well ?

Thank you all for your help,

William



Le mardi 13 mars 2012 18:44:38 UTC+1, Alan Antonuk a écrit :
>
> basic.get is synchronous call which the client asks the broker: "are there 
> any messages in this queue, if so please give me one".
>
> 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.
>
> 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). 
>
> -Alan
>
> On Tue, Mar 13, 2012 at 12:40 PM, Jacques du Rand <jacq... at gmail.com<javascript:>
> > wrote:
>
>> Hi guys. 
>> 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?  
>> Regards
>> Jacques
>>
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq... at lists.rabbitmq.com <javascript:>
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131114/6920b534/attachment.htm>


More information about the rabbitmq-discuss mailing list