Priority Queues — Concept Check
Questions on Priority Queues. Declare x-max-priority on a queue to enable priority levels (0–255); higher-priority messages are delivered first, allowing urgent tasks to skip ahead of normal work.
Questions in this quiz
8 questions on Priority Queues — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A service using RabbitMQ priority queues is experiencing high memory usage. What could be a cause?
- AThe queue is not durable, leading to memory leaks.
- Bx-max-priority is set too high, consuming more memory for sub-queues.
- CConsumers are not keeping up with the message rate.
- DMessages are not being acknowledged, causing memory bloat.
2.In a RabbitMQ setup, urgent order cancellations need to be processed before regular updates. How should the priority queue be configured?
- ASet x-max-priority to a small value and assign higher priority to cancellations.
- BUse a single FIFO queue for all messages.
- CUse separate queues for cancellations and updates.
- DSet x-max-priority to a high value for more granularity.
3.A developer sets the prefetch count to 10 in a priority queue consumer. What might be a consequence?
- AHigh-priority messages will always be processed first.
- BMemory usage will decrease due to fewer messages in the queue.
- CThe queue will operate in FIFO order regardless of priority.
- DLow-priority messages may be processed before high-priority ones.
4.What is a key limitation of using x-max-priority in RabbitMQ queues?
- AIt automatically increases memory usage with more messages.
- BIt requires a separate queue for each priority level.
- CIt cannot handle more than 5 priority levels.
- DIt only works with classic queues, not quorum queues.
5.A company uses RabbitMQ priority queues for API requests. What happens if the consumers keep up with the producers?
- AMessages are delivered in arrival order regardless of priority.
- BMessages are delivered randomly, ignoring priority.
- CLow-priority messages are delayed indefinitely.
- DHigh-priority messages are still delivered first.
6.Why might a developer choose separate queues over x-max-priority for handling different priority levels?
- ASeparate queues are unsupported by Spring AMQP.
- BSeparate queues have no memory overhead per level.
- Cx-max-priority does not support dynamic reordering.
- Dx-max-priority allows more than 10 levels, causing complexity.
7.A RabbitMQ setup uses x-max-priority with a max level of 10. What is a potential downside of this configuration?
- AThe queue cannot handle more than 10 messages.
- BUnused priority levels still consume memory resources.
- CConsumers must be manually configured for each priority level.
- DPriority levels above 5 are ignored.
8.How does setting a high x-max-priority value affect RabbitMQ's memory usage?
- AHas no effect on memory usage.
- BCauses memory leaks due to unacknowledged messages.
- CDecreases memory usage by optimizing message handling.
- DIncreases memory usage due to more sub-queues.