Messages delivered to several consumers when using noAck

317 views
Skip to first unread message

Jose Luis Fernández Pérez

unread,
Sep 17, 2015, 6:35:13 AM9/17/15
to rabbitmq-users
Hi!

I am connecting several consumers into one single queue setting the noAck to true (that queue is in turn connected to a topic exchange). That means, if I don't misunderstand the documentation, that messages are thought to be delivered right after it is given to a consumer. The issue here is that Im receiving the same message in different consumers, does it make any sense? Do I need to use ack's if I want to ensure that the same message can't be delivered to several consumers?

Thanks in advance, Jose Fernández.

Giuseppe Privitera

unread,
Sep 17, 2015, 7:02:48 AM9/17/15
to rabbitm...@googlegroups.com
This is the normal behaviour for a topic exchange (http://www.rabbitmq.com/tutorials/tutorial-five-python.html). If you want your subscribers to consume messages in round-robin, check this tutorial: http://www.rabbitmq.com/tutorials/tutorial-two-python.html

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Sep 17, 2015, 7:08:05 AM9/17/15
to rabbitm...@googlegroups.com, josef...@gmail.com
 > I am connecting several consumers into one single queue setting 
> the noAck to true (that queue is in turn connected to a topic exchange).
> That means, if I don't misunderstand the documentation, that
> messages are thought to be delivered right after it is given to
> a consumer. The issue here is that Im receiving the same message
> in different consumers, does it make any sense? Do I need to use
> ack's if I want to ensure that the same message can't be delivered
> to several consumers?

we can’t suggest much specifics without seeing your code.

Multiple consumers on a single shared queue cannot get a copy of the same messages.
Messages are distributed among the consumers according to QoS.

So you almost certainly have a queue per consumer and use an exchange type that
can/does distribute messages to more than one queue at once. Is this intentional?

In any case, I think in this case code would help even more than an explanation
of the intent ;)
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Jose Luis Fernández Pérez

unread,
Sep 17, 2015, 7:25:54 AM9/17/15
to rabbitmq-users, josef...@gmail.com

Uhmm. I don't have several queues. 


The whole thing is kind of complex. We need a way to control when consumers die. For doing so we use the exchange-event plugin and we bind a queue to consumer.deleted routing_key. What im experimenting is that I receive several messages for the same event, so maybe the issue is related to the plugin itself instead of the way rabbit delivers messages between consumers. I wanted to ensure that my understanding of the message delivery between consumers is the one I think before digging deeper.


Thanks!

Michael Klishin

unread,
Sep 17, 2015, 7:29:02 AM9/17/15
to rabbitm...@googlegroups.com, Jose Luis Fernández Pérez
On 17 Sep 2015 at 14:25:57, Jose Luis Fernández Pérez (josef...@gmail.com) wrote:
> Uhmm. I don't have several queues.
>
> This is the queue involved: https://dl.dropboxusercontent.com/u/65398007/Screenshots/caegee4zosho2EeGhah0aihohvie9oar.png
>
> The whole thing is kind of complex. We need a way to control when
> consumers die. For doing so we use the exchange-event plugin
> and we bind a queue to consumer.deleted routing_key. What im
> experimenting is that I receive several messages for the same
> event, so maybe the issue is related to the plugin itself instead
> of the way rabbit delivers messages between consumers. I wanted
> to ensure that my understanding of the message delivery between
> consumers is the one I think before digging deeper.

It could be that your consumer (the app) closes the channel and other consumers
get a redelivery. But you don’t use manual acknowledgements.

Again, a single message in a queue can also be delivered to one consumer
at a time. This is how the core protocol works.

You still haven’t mentioned

 * What client you use
 * What plugin is involved and how
 * What documentation guide  you are referring to
Reply all
Reply to author
Forward
0 new messages