[Other] Clarification on message balancing when consuming from multiple queues on a single channel #13486
-
Community Support Policy
RabbitMQ version used4.0.3 How is RabbitMQ deployed?Community Docker image Steps to reproduce the behavior in questionI'm trying to understand how RabbitMQ prioritizes message delivery when consuming from multiple queues on the same channel with a limited prefetch size (on the channel). E.g., if I subscribe to queues A, B, and C on the same channel with prefetch=1, if none of the queues are empty what order will messages be delivered in? Is there going to be some default balancing between consumers to ensure that the consumers on the channel are given an even share of messages? Is there any documentation that explains this behavior? Any clarification would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
RabbitMQ do not do any prioritization across queues beyond what consumer priorities instruct it to do. You cannot assume any specific ordering regardless of consumer priorities used. Assuming equal consumer priorities, RabbitMQ will deliver as many messages as it can until it hits the prefetch limit. After that any deliveries that were sent internally from the queue replica to the channel process will soon enough be stopped by a component known as the prefetch limit plus the internal flow control mechanism. |
Beta Was this translation helpful? Give feedback.
RabbitMQ do not do any prioritization across queues beyond what consumer priorities instruct it to do.
You cannot assume any specific ordering regardless of consumer priorities used.
Assuming equal consumer priorities, RabbitMQ will deliver as many messages as it can until it hits the prefetch limit. After that any deliveries that were sent internally from the queue replica to the channel process will soon enough be stopped by a component known as the prefetch limit plus the internal flow control mechanism.