Creates a queue.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateQueue | The operation that you want to perform. Set the value to CreateQueue. |
InstanceId | String | Yes | amqp-cn-v0h1kb9nu*** | The ID of the instance. |
QueueName | String | Yes | DemoQueue | The name of the queue to be created.
|
RegionId | String | Yes | cn-hangzhou | The ID of the region. |
VirtualHost | String | Yes | test | The name of the virtual host (vhost). The name must be 1 to 255 characters in length, and can contain only letters, digits, and the following special characters: -_.#/@ |
AutoDeleteState | Boolean | No | false | Specifies whether to automatically delete the queue. Valid values:
|
ExclusiveState | Boolean | No | false | Specifies whether the exchange is an exclusive exchange. Valid values:
|
MessageTTL | Long | No | 1000 | The message time to live (TTL) of the queue.
|
AutoExpireState | Long | No | 10000 | 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 use this feature, submit a ticket. |
MaxLength | Long | No | 1000 | The current version does not support this parameter. The maximum number of messages that can be stored in the queue. If this threshold is exceeded, the earliest messages that are routed to the queue are discarded. |
DeadLetterExchange | String | No | DLExchange | The dead-letter exchange. A dead-letter exchange is used to receive rejected messages. If a consumer rejects a message that cannot be retried, this message is routed 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. |
DeadLetterRoutingKey | String | No | test.dl | The dead-letter routing key. The name must be 1 to 255 characters in length, and can contain only letters, digits, and the following special characters: -_.#/@ |
MaximumPriority | Integer | No | 10 | Queue priorities are not supported. The value does not affect the call and return results. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 59B52E2C-0B8E-44EC-A314-D0314A50*** | The ID of the request. |
Examples
Sample requests
http(s)://amqp-open.cn-hangzhou.aliyuncs.com/?Action=CreateQueue
&InstanceId=amqp-cn-v0h1kb9nu***
&MaxLength=1000
&QueueName=DemoQueue
&RegionId=cn-hangzhou
&VirtualHost=test
&<Common request parameters>
Sample success responses
XML
format
<CreateQueueResponse>
<RequestId>59B52E2C-0B8E-44EC-A314-D0314A50***</RequestId>
</CreateQueueResponse>
JSON
format
{
"RequestId":"59B52E2C-0B8E-44EC-A314-D0314A50***"
}
Error codes
For a list of error codes, visit the API Error Center.