[Questions] Question about behavior of non durable classic queues #12829
-
Community Support Policy
RabbitMQ version used3.13.7 or older Erlang version used26.2.x Operating system (distribution) usedRed hat How is RabbitMQ deployed?RPM package rabbitmq-diagnostics status outputSee https://www.rabbitmq.com/docs/cli to learn how to use rabbitmq-diagnostics
Logs from node 1 (with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 2 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
Logs from node 3 (if applicable, with sensitive values edited out)See https://www.rabbitmq.com/docs/logging to learn how to collect logs
rabbitmq.confSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find rabbitmq.conf file location
Steps to deploy RabbitMQ cluster
Steps to reproduce the behavior in question
advanced.configSee https://www.rabbitmq.com/docs/configure#config-location to learn how to find advanced.config file location
Application code# PASTE CODE HERE, BETWEEN BACKTICKS Kubernetes deployment file# Relevant parts of K8S deployment that demonstrate how RabbitMQ is deployed
# PASTE YAML HERE, BETWEEN BACKTICKS What problem are you trying to solve?Hello team, I want to open a discussion about a situation we encountered recently with RabbitMQ. Setup:
At some point, the cluster experienced a short lived partition event (lasted about 12 seconds I think) where one node got isolated from the other three.
After the partition was resolved, we noticed that we stopped getting messages to one of the clients connected to the node that got temporarily partitioned. Upon further examination, we saw that the queue was deleted during the partition recovery phase as can be seen from the logs:
But the client consumer was not notified about this. To us this poses a risk of losing messages and would like an opinion on how to handle this case if possible. Is this actually a feature or a bug? Tested with RabbitMQ 4.0 and the behavior is the same. What would you recommend we do? Thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
This is one of the reasons transient non-exclusive queues have been deprecated: They are still allowed in 4.0 by default, but you can configure RabbitMQ to not allow them:
What you are observing is most likely a race condition. The intended order of events would be:
However, sometimes the application redeclares the queue first and only then the nodes deletes it, which means it deletes the new (post-partition) incarnation of the queue. Exclusive server-named queues are the solution since their new incarnation would be named differently. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
This is one of the reasons transient non-exclusive queues have been deprecated:
https://www.rabbitmq.com/blog/2021/08/21/4.0-deprecation-announcements#removal-of-transient-non-exclusive-queues
They are still allowed in 4.0 by default, but you can configure RabbitMQ to not allow them:
What you are observing is most likely a race condition. The intended order of events would be:
However, sometimes the application redeclares the queue first and only then the nodes…