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
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, Message Queue 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.

MaximumPriority Number No No Queue priorities are not supported. None.
InstanceId String Yes No The ID of the instance. None.
ExclusiveState Boolean No No Specifies whether the exchange is an exclusive exchange. Valid values:
  • true: The exchange is an exclusive exchange.

    Only the connection that declares the exclusive exchange can use the exclusive exchange. After the connection is closed, the exclusive exchange is automatically deleted.

  • false: The exchange is not an exclusive exchange.
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.

VirtualHost String Yes No The name of the vhost. 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.

MaxLength Number No No The maximum number of messages in the queue. This property is unavailable for Message Queue for RabbitMQ.

If the maximum number of messages in the queue is exceeded, the earliest messages that are stored in the queue are deleted.

AutoDeleteState Boolean No No Specifies whether to automatically delete the queue. Valid values:
  • true: automatically deletes the queue.

    After the last subscription from a consumer to the queue is canceled, the queue is automatically deleted.

  • false: does not automatically delete the queue.
QueueName String Yes No The name of the queue. When you specify the name, take note of the following items:
  • 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 (@).
  • After the queue is created, you cannot change the name of the queue. If you want to change the name, you must delete the queue and create a new queue.
MessageTTL Number No No The message time-to-live (TTL) of the queue. Unit: milliseconds. When you specify the message TTL, take note of the following items:
  • If the retention period of a message in the queue exceeds the message TTL, the message expires.
  • The value of this property must be a non-negative integer. The maximum message TTL is 86400 milliseconds. For example, if the message TTL is 1,000 milliseconds, the message can be retained for up to 1 second in the queue.
AutoExpireState Number No No The period of time after which the queue is automatically deleted. 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 after you enable the feature. If you want to enable the feature, submit a ticket.

Return values

Fn::GetAtt

QueueName: the name of the queue.

Examples

  • 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"
            ]
          }
        }
      }
    }
  • 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