Change a queue's settings
Change a queue's visibility timeout, retention, delivery delay, receive wait, maximum message size or content-based deduplication.
Replace my-queue with the name of your queue. The settings are defaults for new messages: a message keeps the retention it was sent with, so a new retention applies to messages sent afterwards. The ranges are in Create a queue. A queue's name and its type (standard or FIFO) cannot be changed.
Prerequisites
- Permission for
queue:SetQueueAttributeson the queue. Without it, the console shows the settings but does not let you change them. - For the console, also
queue:GetQueueAttributeson the queue, to open its page.
Change the settings
- Open the queue, then choose Settings (or, in the ⋯ menu, Edit settings).
- Under Delivery, change Visibility timeout (seconds), Retention (seconds), Delivery delay (seconds), Receive wait (seconds) or Maximum message size (bytes).
- Choose Save.
Save saves both sections of the page, the dead-letter queue included. Content-based deduplication cannot be changed in the console.
dcloud queue queues set-attributes my-queue --visibility-timeout-seconds 120 --receive-wait-seconds 20On a FIFO queue, --content-based-deduplication turns content-based deduplication on and
--no-content-based-deduplication turns it off.
PATCH /queue/api/queues/my-queue
{ "visibilityTimeoutSeconds": 120, "receiveWaitSeconds": 20 }Only the fields you send change. On a FIFO queue, "contentBasedDeduplication": true or false
turns content-based deduplication on or off.
Change the arguments of the dcloud_queue resource (visibility_timeout_seconds,
retention_seconds, delay_seconds, receive_wait_seconds, maximum_message_bytes,
content_based_deduplication) and apply. Changing name or fifo replaces the queue and deletes
its messages.
Result
The API answers 200 with the queue's new settings. New receives and sends use them at once.
When a change is refused
400"ContentBasedDeduplication applies only to FIFO queues." on a standard queue.404"There is no queue named “my-queue” here."