Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Message Queue
  • Access management
  • Pricing policy
  • Terraform reference
    • Overview
      • CreateQueue
      • DeleteQueue
      • GetQueueAttributes
      • GetQueueUrl
      • ListQueues
      • PurgeQueue
      • SetQueueAttributes
      • TagQueue
      • UntagQueue
      • ListQueueTags
    • Common errors
  • Monitoring metrics
  • Public materials
  • FAQ

In this article:

  • Request
  • Request parameters
  • Response
  • Successful response fields
  • SetQueueAttributes errors
  • Sample request
  • Response example
  1. API reference
  2. Queue
  3. SetQueueAttributes

SetQueueAttributes

Written by
Yandex Cloud
Updated at May 13, 2024
  • Request
    • Request parameters
  • Response
    • Successful response fields
    • SetQueueAttributes errors
  • Sample request
  • Response example

Method for setting attributes for the specified queue. It may take up to 60 seconds to change attributes. It may take up to 15 minutes to change the MessageRetentionPeriod attribute.

Request

Request parameters

Parameter Type Required parameter Description
QueueUrl string Yes URL of a queue.
Attributes.N.* list of attributes Yes List of queue attributes.

Attributes

Queue attributes. Attributes are sent as a list. For more information about passing list parameters, see Using the API.

Attribute.N.Name (attribute)
Attribute.N.Value (attribute value)
Attribute Type Description
DelaySeconds integer Number of seconds to delay the message from being available for processing. Valid values: from 0 to 900 seconds (15 minutes). Default: 0.
MaximumMessageSize integer Maximum message size in bytes. Valid values: from 1024 bytes (1 KB) up to 262144 bytes (256 KB). Default: 262144 (256 KB).
MessageRetentionPeriod integer The length of time in seconds to retain a message. Valid values: from 60 seconds (1 minute) up to 1209600 seconds (14 days). Default: 345600 (4 days).
ReceiveMessageWaitTimeSeconds integer Wait time for the ReceiveMessage action, in seconds. Valid values: from 0 to 20 seconds. Default: 0.
RedrivePolicy string Redirect policy for moving messages to a dead-letter queue. The source queue and DLQ must be the same type: for FIFO queues, the DLQ must also be a FIFO queue. It includes two parameters:
  • deadLetterTargetArn: ARN of the DLQ that messages are moved to. You can get the queue's ARN by calling the GetQueueAttributes method.
  • maxReceiveCount is the maximum number of attempts to read a message from the queue before redriving it to the DLQ. When the ReceiveCount value for the message exceeds the value of maxReceiveCount, the message is moved to the DLQ.
VisibilityTimeout integer Visibility timeout for the queue, specified in seconds. Valid values: from 0 to 43000 seconds. Default: 30.

FIFO queue attributes

Attribute Description
ContentBasedDeduplication Enables content-based deduplication. It may take either the true or false value.

Non-supported attributes

Attribute Type Description
KmsMasterKeyId string Not supported in Yandex Message Queue.
KmsDataKeyReusePeriodSeconds string Not supported in Yandex Message Queue.

Response

Successful response fields

The response does not contain any fields.

SetQueueAttributes errors

For a list of errors common for all methods, see Common errors.

HTTP code Error ID Description
400 InvalidAttributeName The attribute name is invalid.

Sample request

Action=SetQueueAttributes
&Version=2012-11-05
&QueueUrl=https://message-queue.api.cloud.yandex.net/b1g8ad42m6he********/dj6000000000********/sample-queue
&Attribute.1.Name=DelaySeconds
&Attribute.1.Value=10
&Attribute.2.Name=VisibilityTimeout
&Attribute.2.Value=20

For more information about forming requests, see General API request format.

Response example

<SetQueueAttributesResponse>
    <ResponseMetadata>
        <RequestId>87acfbed-5254a88a-ef8d6306-e5fd93e-74626d14b02d992c99e5fa1b********</RequestId>
    </ResponseMetadata>
</SetQueueAttributesResponse>

Was the article helpful?

Previous
PurgeQueue
Next
TagQueue
Yandex project
© 2025 Yandex.Cloud LLC