<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">What library are you using?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">basic.consume() is not quite as simple as your code would imply. While it is issuing a RPC request to start consuming, most libraries have some semantics around its use such as registering a callback or setting up behaviors for what happens when messages are received from RabbitMQ. I think there’s more to what’s going on than you realize.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div> <div id="bloop_sign_1387222297580329984" class="bloop_sign"></div> <div style="color:gray"><hr style="style:linear">From: <span style="color:black">Raj Kumar Sanpui</span> <a href="mailto:raj.kumar.sanpui@gmail.com">Raj Kumar Sanpui</a><br>Reply: <span style="color:black">Discussions about RabbitMQ</span> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>Date: <span style="color:black">December 16, 2013 at 2:31:26 PM</span><br>To: <span style="color:black">Discussions about RabbitMQ</span> <a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>Subject: <span style="color:black"> Re: [rabbitmq-discuss] Why does the queue drop other messages after the first is consumed? <br></span></div> <blockquote type="cite" class="clean_bq"><span><div><div>
<title></title>
<div dir="ltr">Agreed, but something as simple as:
<div><br></div>
<div>{{{</div>
<div>pthread_mutex_lock(&mutex);</div>
<div>basic.consume( );</div>
<div>pthread_mutex_unlock(&mutex);<br></div>
<div>}}}</div>
<div><br></div>
<div>Should not have any issues (unless the library you are using
has), and there are no issues in above code, if you can see.</div>
<div><br></div>
<div><br></div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, Dec 17, 2013 at 12:40 AM, Alvaro
Videla <span dir="ltr"><<a href="mailto:videlalvaro@gmail.com" target="_blank">videlalvaro@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Well it might be the code is corrupting the channel state,
RabbitMQ<br>
will just act based on the order you send AMQP commands to it. If
your<br>
code sends those commands in the wrong order, then errors
might<br>
happen, for example ack'ing the wrong message or things like
that.<br>
<br>
RabbitMQ is a server, which means, it is not concerned on
which<br>
threading library your application is using, or even if it is
using<br>
threads at all. Your application will send "requests" to RabbitMQ
and<br>
RabbitMQ will service them. In this case the requests are
AMQP<br>
commands.<br>
<br>
Regards,<br>
<br>
Alvaro<br>
<br>
On Mon, Dec 16, 2013 at 6:59 PM, Raj Kumar Sanpui<br>
<div class="HOEnZb">
<div class="h5"><<a href="mailto:raj.kumar.sanpui@gmail.com">raj.kumar.sanpui@gmail.com</a>>
wrote:<br>
> @Alvaro: The same code works perfect, if there are no
pthread_mutex_lock.<br>
><br>
> Can Allan know anything about it.<br>
> @Alan Antonuk: Alan, do you have any issue in your library
with regard to<br>
> thread locks (pthread_mutex_lock) ?<br>
><br>
><br>
><br>
><br>
> On Tue, Dec 17, 2013 at 12:26 AM, Alvaro Videla <<a href="mailto:videlalvaro@gmail.com">videlalvaro@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Well, perhaps either your code or the AMQP library has
that problem.<br>
>> RabbitMQ doesn't know anything about application specific
code.<br>
>><br>
>> On Mon, Dec 16, 2013 at 6:48 PM, Raj Kumar Sanpui<br>
>> <<a href="mailto:raj.kumar.sanpui@gmail.com">raj.kumar.sanpui@gmail.com</a>>
wrote:<br>
>> > Seems like rabbitmq has an allergy towards thread
locks.<br>
>> > Invoke a consumer thread (basic.consume) calling
pthread_mutex_lock( )<br>
>> > and<br>
>> > all but one message gets dropped. Same works
absolutely fine, if no<br>
>> > thread<br>
>> > locks are used.<br>
>> ><br>
>> ><br>
>> > On Mon, Dec 16, 2013 at 11:22 PM, Michael
Klishin<br>
>> > <<a href="mailto:mklishin@gopivotal.com">mklishin@gopivotal.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On 16 Dec 2013, at 21:47, Raj Kumar Sanpui
<<a href="mailto:raj.kumar.sanpui@gmail.com">raj.kumar.sanpui@gmail.com</a>><br>
>> >> wrote:<br>
>> >><br>
>> >> > In between, do we have any man page for
basic.consume?<br>
>> >> ><br>
>> >> > What does "no ack", "exclusive", "local"
stands for?<br>
>> >><br>
>> >> Ignore local. Exclusive means that there can only
ever be one consumer<br>
>> >> on<br>
>> >> the queue.<br>
>> >><br>
>> >> no ack means “no manual ack”, that is, you don’t
intend to use manual<br>
>> >> acknowledgements of<br>
>> >> deliveries. See tutorial 2: <a href="http://www.rabbitmq.com/getstarted.html" target="_blank">http://www.rabbitmq.com/getstarted.html</a><br>
>> >> and <a href="http://www.rabbitmq.com/amqp-0-9-1-reference.html#domain.no-ack" target="_blank">http://www.rabbitmq.com/amqp-0-9-1-reference.html#domain.no-ack</a><br>
>> >><br>
>> >> MK<br>
>> >><br>
>> >> Software Engineer, Pivotal/RabbitMQ<br>
>> >><br>
>> >><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>
>> ><br>
>> ><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>
>> _______________________________________________<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>
><br>
><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>
_______________________________________________<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>
</div>
</div>
</blockquote>
</div>
<br></div>
_______________________________________________
<br>rabbitmq-discuss mailing list
<br>rabbitmq-discuss@lists.rabbitmq.com
<br>https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
<br></div></div></span></blockquote></body></html>