[rabbitmq-discuss] No message is delivered to consumer workers when a message is requeued
Steve Powell
steve at rabbitmq.com
Thu Apr 5 16:05:01 BST 2012
Hi Dinh,
I was confused by your wording:
> I launched 4 workers to
> listen on a single queue
and:
> The
> output of strace shows that worker still polled RabbitMQ for new
> message
and:
> I use the same consumer_tag for all workers.
'Polling' implies you are using 'basic_get' which has explicit control
of acknowledgements. 'Consumers' implies you are using 'basic_consume'
(which is more sensible) and acknowledgements are set on registration.
I'd be interested in knowing what your Consumers do.
I assume that each worker registers a consumer. What
channels/connections/processes do they share? If you use the same
consumer_tag for each consumer, this will only cause problems if they
use the same channel.
I also assume that the consumers are set to explicitly acknowledge the
messages they receive.
If a message is not acknowledged (nor rejected), then pre-fetch count=1
will mean that after everyone of your consumers gets one message that
they haven't acknowledged they won't get any more.
So, what you are reporting sounds like the rejection (a negative
acknowledgement) isn't being recognised.
OR...
Your consumers are being confused -- it is possible your messages are
being rejected and requeued (requeue=True) and immediately being
delivered back to the consumer (or one of the consumers). How do the
consumers react to a redelivered message?
Steve Powell (an easter bunny)
----------some more definitions from the SPD----------
chinchilla (n.) Cooling device for the lower jaw.
socialcast (n.) Someone to whom everyone is speaking but nobody likes.
literacy (n.) A textually transmitted disease usually contracted in childhood.
On 5 Apr 2012, at 06:28, Pham Cong Dinh wrote:
> Hi all,
>
> I got a strange issue with RabbitMQ when I launched 4 workers to
> listen on a single queue to process incoming message.
>
> However, there is a bug with worker that caused an invalid message can
> not be processed successfully. In that case, that message will be
> redelivered back to the original queue using
>
> channel.basic_reject(delivery_tag, requeue=True) # Python code (Kombu
> framework)
> # Just reject the message. Not closing the channel or releasing
> connection after that
>
> As you may guess, none of 4 workers could process the message because
> the bug. After that no worker received incoming message any more. The
> output of strace shows that worker still polled RabbitMQ for new
> message but they received no message. I also listed all the message
> available in the queue using rabbitmqctl and found that there were 4
> unacknowledged messages and a lot of incoming messages in the queue
> too.
>
> Have anyone here experienced the same issue?
>
> My configuration:
>
> consumer_options = {
> 'exchange_name': 'feed',
> 'exchange_type': 'direct',
> 'queue_name': 'feed',
> 'routing_key': 'importer',
> 'durable': True,
> 'delivery_mode': 2,
> 'no_ack': False,
> 'auto_ack': False,
> 'prefetch_count': 1
> }
>
> I use the same consumer_tag for all workers. Did it cause any problem?
>
> Thanks
>
>
> Dinh
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list