Quorum queue x-delivery-count seems inflated

38 views
Skip to first unread message

Kyle Thompson

unread,
Apr 17, 2020, 11:14:36 AM4/17/20
to rabbitmq-users

I am seeing unexpected results when using poison message handling with a quorum queue. I’m specifically testing the case where a consumer crashing during execution and then restarting.

One case gives me the x-delivery-count I expect.
  • Single exchange (topic)
  • One queue bound to exchange
  • Queue has one binding with a routing key specified
  • I send a message directly to the exchange
  • The message crashes the consumer
  • Every time the consumer restarts, the x-delivery-count value increments by one.. cool.

But when I add another binding, with a different routing key, to the same queue, the count increments by 2 each restart. And it continues to grow as I add more bindings, queues, and exchanges. For some consumers, I have seen the x-delivery-count increment as many as 30 per service restart.

Is this the expected behavior of the x-delivery-count value? Or should I expect a single increment of the value each time a consumer crashes and restarts? 

I wonder if it has something do with the server taking time to detect the consumer is down and repeatedly re-queueing the message in the meantime. But the doesn’t seem to explain why adding bindings with different, unrelated, routing keys increases the increment.

I would appreciate any insight into this. 

Thanks. 

Karl Nilsson

unread,
Apr 17, 2020, 11:31:45 AM4/17/20
to rabbitm...@googlegroups.com
Hi,

Something else must be going on. Queues aren't actually aware of their bindings in any way and quorum queues increment the delivery count every time a message is returned from a consumer (either by crash or nack/return). Is your test with two bindings to the same queue still using a single consumer?

Cheers
Karl

--
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 view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/a7a36556-6bf0-46b0-9109-0db90b62259f%40googlegroups.com.


--
Karl Nilsson

Pivotal/RabbitMQ

Kyle Thompson

unread,
Apr 17, 2020, 11:49:54 AM4/17/20
to rabbitmq-users
Hi Karl,

Thanks for the reply. Yeah, this has me scratching my head.. that adding additional bindings has an effect on re-delivery count. I also see the behavior even I send the message directly to the queue, ignoring the exchange completely.

Yes, my test with two bindings is the same queue and a single consumer. All my testing has been with a single consumer. I have the consumer immediately crashing, then on restart I log the x-delivery-count. When the delivery-limit is exceeded it goes to the dead letter queue as expected, just sooner than I want.

Thanks,
Kyle


On Friday, April 17, 2020 at 11:31:45 AM UTC-4, Karl Nilsson wrote:
Hi,

Something else must be going on. Queues aren't actually aware of their bindings in any way and quorum queues increment the delivery count every time a message is returned from a consumer (either by crash or nack/return). Is your test with two bindings to the same queue still using a single consumer?

Cheers
Karl

On Fri, 17 Apr 2020 at 16:14, Kyle Thompson <kyle.b...@gmail.com> wrote:

I am seeing unexpected results when using poison message handling with a quorum queue. I’m specifically testing the case where a consumer crashing during execution and then restarting.

One case gives me the x-delivery-count I expect.
  • Single exchange (topic)
  • One queue bound to exchange
  • Queue has one binding with a routing key specified
  • I send a message directly to the exchange
  • The message crashes the consumer
  • Every time the consumer restarts, the x-delivery-count value increments by one.. cool.

But when I add another binding, with a different routing key, to the same queue, the count increments by 2 each restart. And it continues to grow as I add more bindings, queues, and exchanges. For some consumers, I have seen the x-delivery-count increment as many as 30 per service restart.

Is this the expected behavior of the x-delivery-count value? Or should I expect a single increment of the value each time a consumer crashes and restarts? 

I wonder if it has something do with the server taking time to detect the consumer is down and repeatedly re-queueing the message in the meantime. But the doesn’t seem to explain why adding bindings with different, unrelated, routing keys increases the increment.

I would appreciate any insight into this. 

Thanks. 

--
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 rabbitm...@googlegroups.com.


--
Karl Nilsson

Pivotal/RabbitMQ

Karl Nilsson

unread,
Apr 17, 2020, 12:09:43 PM4/17/20
to rabbitm...@googlegroups.com
Can you provide a minimal test script or similar? Logs might be helpful as well, especially at debug level.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/48d7ab59-929e-432d-b070-f1d99aa1c66e%40googlegroups.com.


--
Karl Nilsson

Pivotal/RabbitMQ

Karl Nilsson

unread,
Apr 20, 2020, 11:23:43 AM4/20/20
to rabbitm...@googlegroups.com
I have tested this with a crashing consumer consuming from a quorum queue with multiple topic exchange bindings and the `x-delivery-count` only increments as expected by 1 after each crash.

If you can provide me with more details I can continue investigations but for now I'm not sure what else to test here.

Cheers
Karl
--
Karl Nilsson

Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages