You can use ALIYUN::AMQP::Queue to create a queue.
Syntax
{
"Type": "ALIYUN::AMQP::Queue",
"Properties": {
"DeadLetterExchange": String,
"MaximumPriority": Number,
"InstanceId": String,
"ExclusiveState": Boolean,
"DeadLetterRoutingKey": String,
"VirtualHost": String,
"MaxLength": Number,
"AutoDeleteState": Boolean,
"QueueName": String,
"MessageTTL": Number,
"AutoExpireState": Number
}
}Properties
Property Name | Type | Required | Update allowed | Description | Constraints |
InstanceId | String | Yes | No | The instance ID. | None |
QueueName | String | Yes | No | The name of the queue. | The name of the queue must meet the following requirements:
|
VirtualHost | String | Yes | No | The vhost name. | The name can contain letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). The length must be 1 to 255 characters. |
AutoDeleteState | Boolean | No | No | Specifies whether to automatically delete the queue. | Valid values:
|
AutoExpireState | Number | No | No | The automatic expiration time of the queue. | The queue is automatically deleted if it is not accessed within the specified time. Note This feature must be enabled before you can use this parameter. To enable this feature, submit a ticket. |
DeadLetterExchange | String | No | No | The dead-letter exchange. | This type of exchange is used to receive rejected messages. If a consumer rejects a message and the message is not requeued, ApsaraMQ for RabbitMQ routes the message to the specified dead-letter exchange. The dead-letter exchange then routes the message to a bound queue for storage. |
DeadLetterRoutingKey | String | No | No | The dead-letter routing key. | The key can contain letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). The length must be 1 to 255 characters. |
ExclusiveState | Boolean | No | No | Specifies whether the exchange is exclusive. | Valid values:
|
MaximumPriority | Number | No | No | Priorities are not a supported feature. | None |
MaxLength | Number | No | No | The maximum number of messages that can be stored in the queue. | This parameter is not supported in the current version. If the maximum number of messages is exceeded, the earliest messages in the queue are deleted. |
MessageTTL | Number | No | No | The time-to-live (TTL) of messages in the queue. | Requirements:
|
Return value
Fn::GetAtt
QueueName: The name of the queue.
Examples
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
InstanceId:
Type: String
Description: The instance ID.
VirtualHost:
Type: String
Description: The name of the virtual host.
QueueName:
Type: String
Description: The name of the queue.
MaxLength: 255
Resources:
Queue:
Type: ALIYUN::AMQP::Queue
Properties:
InstanceId:
Ref: InstanceId
VirtualHost:
Ref: VirtualHost
QueueName:
Ref: QueueName
Outputs:
QueueName:
Description: The name of the queue.
Value:
Fn::GetAtt:
- Queue
- QueueNameJSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "The instance ID."
},
"VirtualHost": {
"Type": "String",
"Description": "The name of the virtual host."
},
"QueueName": {
"Type": "String",
"Description": "The name of the queue.",
"MaxLength": 255
}
},
"Resources": {
"Queue": {
"Type": "ALIYUN::AMQP::Queue",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
},
"VirtualHost": {
"Ref": "VirtualHost"
},
"QueueName": {
"Ref": "QueueName"
}
}
}
},
"Outputs": {
"QueueName": {
"Description": "The name of the queue.",
"Value": {
"Fn::GetAtt": [
"Queue",
"QueueName"
]
}
}
}
}