Creates a queue. In ApsaraMQ for RabbitMQ, a queue is a message queue. All messages in ApsaraMQ for RabbitMQ are sent to a specific exchange and then routed to a bound queue by the exchange.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
amqp:CreateQueue | create | *Queue acs:amqp:{#regionId}:{#accountId}:/instances/{#instanceId}/vhosts/{#vhostName}/queues/* |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the ApsaraMQ for RabbitMQ instance on which you want to create a queue. | amqp-cn-v0h1kb9nu*** |
VirtualHost | string | Yes | The name of the vhost to which the queue that you want to create belongs. The name must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). | test |
QueueName | string | Yes | The name of the queue that you want to create.
| DemoQueue |
AutoDeleteState | boolean | No | Specifies whether to automatically delete the queue. Valid values:
| false |
ExclusiveState | boolean | No | Specifies whether the exchange is an exclusive exchange. Valid values:
| false |
MessageTTL | long | No | The message time to live (TTL) of the queue.
| 1000 |
AutoExpireState | long | No | The validity period after which the queue is automatically deleted. If the queue is not accessed within the specified period of time, the queue is automatically deleted. Unit: milliseconds. Note
You can use the feature that corresponds to this parameter only after you enable the feature. To enable the feature, submit a ticket.
| 10000 |
MaxLength | long | No | This parameter is unavailable in the current version of ApsaraMQ for RabbitMQ. The maximum number of messages that can be stored in the queue. If this threshold is exceeded, the earliest stored messages in the queue are deleted. | 1000 |
DeadLetterExchange | string | No | The dead-letter exchange. A dead-letter exchange is used to receive rejected messages. If a consumer rejects a message that cannot be redelivered, ApsaraMQ for RabbitMQ routes the message to the specified dead-letter exchange. Then, the dead-letter exchange routes the message to the queue that is bound to the dead-letter exchange for storage. | DLExchange |
DeadLetterRoutingKey | string | No | The dead-letter routing key. The key must be 1 to 255 characters in length, and can contain only letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). | test.dl |
MaximumPriority | integer | No | Queue priorities are not supported. The value does not affect the call or return results. | 10 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "59B52E2C-0B8E-44EC-A314-D0314A50***"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|