ALIYUN::AMQP::Queue is used 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 | Type | Required | Editable | Description | Constraint |
InstanceId | String | Yes | No | The instance ID. | None. |
QueueName | String | Yes | No | The queue name. | When you specify the name, take note of the following items:
|
VirtualHost | String | Yes | No | The vhost name. | The vhost name can contain only letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). The vhost name must be 1 to 255 characters in length. |
AutoDeleteState | Boolean | No | No | Specifies whether to automatically delete the queue. | Valid values:
|
AutoExpireState | Number | No | No | The period of time after which the queue expires. | If the queue is not accessed within the specified period of time, the queue is automatically deleted. Note You can use the feature that corresponds to this property only after you enable the feature. To use this feature, submit a ticket. |
DeadLetterExchange | String | No | No | The dead-letter exchange. | A dead-letter exchange is used to receive rejected messages. If a consumer rejects a message that cannot be retried, 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. |
DeadLetterRoutingKey | String | No | No | The dead-letter routing key. | The key name can contain only letters, digits, hyphens (-), underscores (_), periods (.), number signs (#), forward slashes (/), and at signs (@). The key name must be 1 to 255 characters in length. |
ExclusiveState | Boolean | No | No | Specifies whether the exchange is an exclusive exchange. | Valid values:
|
MaximumPriority | Number | No | No | Queue priorities are not supported. | None. |
MaxLength | Number | No | No | The maximum number of messages in the queue. | This parameter is unavailable in the current version of ApsaraMQ for RabbitMQ. If the maximum number of messages in the queue is exceeded, the earliest messages that are stored in the queue are deleted. |
MessageTTL | Number | No | No | The time-to-live (TTL) of messages in the queue. Unit: milliseconds. | When you specify the message TTL, take note of the following items:
|
Return values
Fn::GetAtt
QueueName: the queue name.
Examples
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
InstanceId:
Type: String
Description: InstanceId
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
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "InstanceId"
},
"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"
]
}
}
}
}