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
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
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
  • CreateQueue errors
  • Request example
  • Response example
  1. API reference
  2. Queue
  3. CreateQueue

CreateQueue

Written by
Yandex Cloud
Updated at March 31, 2025
  • Request
    • Request parameters
  • Response
    • Successful response fields
    • CreateQueue errors
  • Request example
  • Response example

Method for creating a new standard or FIFO queue.

By default, a standard queue is created. To create a FIFO queue, use the FifoQueue parameter.

Note

You cannot change the type of a created queue from standard to FIFO. To change the type, either create a new queue, or delete the old one and re-create it as a FIFO queue.

If a queue is recreated with the same name, it will be assigned a new QueueUrl different from the old one.

If you deleted a queue, you can create another queue with the same name after 60 seconds.

The queue name must be unique within the folder and cannot exceed 80 characters. It may contain numbers, letters, underscores, and hyphens. The name of a FIFO queue must end with the .fifo suffix.

Note

Always store the queue URL in the system in exactly the same form in which it is returned by Message Queue when the queue is created. Do not form a URL out of individual parts because they may change.

RequestRequest

Request parametersRequest parameters

Parameter Type Required parameter Description
QueueName string Yes Queue name. The maximum length is 80 characters. It may contain numbers, letters, underscores, and hyphens. The name of a FIFO queue must end with the .fifo suffix.
Attributes.N.* list of attributes No List of queue attributes.
Tags.N.* list of labels No List of queue labels.

AttributesAttributes

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 Time in seconds the messages will remain hidden after they are sent. Valid values: from 0 to 900 seconds (15 minutes). The default value is 0.
MaximumMessageSize integer Maximum message size in bytes. Valid values: from 1024 bytes (1 KB) to 262144 bytes (256 KB). The default value is 262144 (256 KB).
MessageRetentionPeriod integer Message retention period, seconds. Valid values: from 60 seconds (1 minute) to 1209600 seconds (14 days). Default: 345600 (4 days).
ReceiveMessageWaitTimeSeconds integer Wait time for the ReceiveMessage method, seconds. The valid values are 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 the messages will be moved to. You can get the queue's ARN by calling the GetQueueAttributes method.
  • maxReceiveCount: Maximum number of attempts to read a message from a queue before redirecting it to the DLQ. When ReceiveCount exceeds maxReceiveCount for a given message, the message is moved to the DLQ.
VisibilityTimeout integer Visibility timeout for the queue, seconds. Valid values: from 0 to 43000 seconds. Default: 30.

FIFO queue attributesFIFO queue attributes

Attribute Description
FifoQueue Returns whether the queue is FIFO.

The possible values are true or false.

If this parameter is not used, a standard queue is created. You cannot change the parameter value for a created queue. When sending messages to a FIFO queue, explicitly specify their MessageGroupId.

ContentBasedDeduplication Enables content-based deduplication. The possible values are true or false.

Non-supported attributesNon-supported attributes

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

LabelsLabels

Learn more about queue labels.

ResponseResponse

Successful response fieldsSuccessful response fields

Field Type Description
QueueUrl string URL of a created queue.

CreateQueue errorsCreateQueue errors

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

HTTP Error code Description
400 QueueDeletedRecently A queue with the same name has been deleted recently. You can create another queue with the same name 60 seconds after deleting the old one.
400 QueueAlreadyExists The queue with the specified name already exists.

Request exampleRequest example

Action=CreateQueue
&Version=2012-11-05
&QueueName=sample-queue-2
&Attribute.1.Name=VisibilityTimeout
&Attribute.1.Value=30
&Tag.1.Key=environment
&Tag.1.Value=production

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

Response exampleResponse example

<CreateQueueResponse>
    <CreateQueueResult>
        <QueueUrl>
            https://message-queue.api.cloud.yandex.net/b1g8ad42m6he********/dj6000000000********/sample-queue
        </QueueUrl>
    </CreateQueueResult>
    <ResponseMetadata>
        <RequestId>
            e4c69a67-f2809a49-6b326386-14d2a08-af8eb419750efa1dbcabf184********
        </RequestId>
    </ResponseMetadata>
</CreateQueueResponse>

Was the article helpful?

Previous
Overview
Next
DeleteQueue
© 2025 Direct Cursus Technology L.L.C.