0
0
RabbitMQdevops~10 mins

Queue length limits in RabbitMQ - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set a maximum length of 1000 messages for the queue.

RabbitMQ
rabbitmqctl set_policy TTL "^queue_name$" '{"max-length": [1]' --apply-to queues
Drag options to blanks, or click blank then click option'
A1000
B5000
C100
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 disables the limit, which is not the goal.
Setting too high a number may cause memory issues.
2fill in blank
medium

Complete the code to declare a queue with a maximum length of 500 messages using the RabbitMQ management plugin.

RabbitMQ
rabbitmqadmin declare queue name=my_queue durable=true arguments='{"[1]":500}'
Drag options to blanks, or click blank then click option'
Ax-max-length
Bmax-length
Cmax_messages
Dqueue-length
Attempts:
3 left
💡 Hint
Common Mistakes
Using max-length without the x- prefix causes the setting to be ignored.
3fill in blank
hard

Fix the error in the policy JSON to correctly limit the queue length to 2000 messages.

RabbitMQ
rabbitmqctl set_policy limit_length ".*" '{"[1]": 2000}' --apply-to queues
Drag options to blanks, or click blank then click option'
Aqueue-max-length
Bx-max-length
Cmax_length
Dmax-length
Attempts:
3 left
💡 Hint
Common Mistakes
Using x-max-length causes the policy to be ignored.
4fill in blank
hard

Fill both blanks to declare a queue with a max length of 300 and a max priority of 10.

RabbitMQ
rabbitmqadmin declare queue name=priority_queue durable=true arguments='{"[1]":300, "[2]":10}'
Drag options to blanks, or click blank then click option'
Ax-max-length
Bx-max-priority
Cmax-length
Dmax-priority
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys without x- prefix will not apply the settings.
5fill in blank
hard

Fill all three blanks to create a policy named 'limit_policy' that applies to all queues, setting max length to 1500 and overflow behavior to drop oldest messages.

RabbitMQ
rabbitmqctl set_policy [1] ".*" '{"[2]":1500, "[3]":"drop-head"}' --apply-to queues
Drag options to blanks, or click blank then click option'
Alimit_policy
Bx-max-length
Coverflow
Dmax-length
Attempts:
3 left
💡 Hint
Common Mistakes
Using x-max-length instead of max-length.
Using x-overflow instead of overflow.