Complete the code to set a maximum length of 1000 messages for the queue.
rabbitmqctl set_policy TTL "^queue_name$" '{"max-length": [1]' --apply-to queues
The max-length property limits the queue to 1000 messages.
Complete the code to declare a queue with a maximum length of 500 messages using the RabbitMQ management plugin.
rabbitmqadmin declare queue name=my_queue durable=true arguments='{"[1]":500}'
max-length without the x- prefix causes the setting to be ignored.The argument x-max-length sets the maximum number of messages the queue can hold.
Fix the error in the policy JSON to correctly limit the queue length to 2000 messages.
rabbitmqctl set_policy limit_length ".*" '{"[1]": 2000}' --apply-to queues
x-max-length causes the policy to be ignored.The correct key for queue length limit in policies is max-length.
Fill both blanks to declare a queue with a max length of 300 and a max priority of 10.
rabbitmqadmin declare queue name=priority_queue durable=true arguments='{"[1]":300, "[2]":10}'
x- prefix will not apply the settings.x-max-length sets the queue length limit, and x-max-priority sets the max priority.
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.
rabbitmqctl set_policy [1] ".*" '{"[2]":1500, "[3]":"drop-head"}' --apply-to queues
x-max-length instead of max-length.x-overflow instead of overflow.The policy name is limit_policy. The key max-length sets the max messages, and overflow controls overflow behavior.