全部产品
Search
文档中心

资源编排:DATASOURCE::MNS::Queue

更新时间:Aug 12, 2024

DATASOURCE::MNS::Queue类型用于获取某个已创建队列的属性。

语法

{
  "Type": "DATASOURCE::MNS::Queue",
  "Properties": {
    "QueueName": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

QueueName

String

队列名称。

返回值

Fn::GetAtt

  • ActiveMessages:在该 Queue 中处于 Active 状态的消息总数

  • PollingWaitSeconds:当 Queue 消息量为空时,针对该 Queue 的 ReceiveMessage 请求最长的等待时间

  • MaximumMessageSize:发送到该 Queue 的消息体的最大长度

  • CreateTime:Queue 的创建时间。

  • VisibilityTimeout:消息从该 Queue 中取出后从 Active 状态变成 Inactive 状态后的持续时间。

  • QueueInternalUrl:Queue的私有URL。

  • LastModifyTime:修改 Queue 属性信息最近时间

  • QueueUrl:Queue的URL。

  • LoggingEnabled:是否开启日志管理功能。

  • DelayMessages:在该 Queue 中处于 Delayed 状态的消息总数

  • DelaySeconds:发送到该 Queue 的所有消息的延迟时间

  • MessageRetentionPeriod:消息在该 Queue 中最长的存活时间

  • InactiveMessages:在该 Queue 中处于 Inactive 状态的消息总数

  • QueueName:Queue 的名称。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      QueueName:
        Type: String
        Description:
          en: The name of the MNS queue.
        Required: true
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::MNS::Queue
        Properties:
          QueueName:
            Ref: QueueName
    Outputs:
      ActiveMessages:
        Description: The total number of active messages in the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - ActiveMessages
      PollingWaitSeconds:
        Description: The maximum time period that a ReceiveMessage request can wait till a message is in the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - PollingWaitSeconds
      MaximumMessageSize:
        Description: The maximum size of a message that can be sent to the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - MaximumMessageSize
      CreateTime:
        Description: The time when the queue was created.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - CreateTime
      VisibilityTimeout:
        Description: The duration for which a message stays in the Inactive state after it is consumed from the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - VisibilityTimeout
      QueueInternalUrl:
        Description: The internal URL of the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - QueueInternalUrl
      LastModifyTime:
        Description: The most recent time when the queue was modified.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - LastModifyTime
      QueueUrl:
        Description: The URL of the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - QueueUrl
      LoggingEnabled:
        Description: Specifies whether to enable the log management feature.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - LoggingEnabled
      DelayMessages:
        Description: The total number of delayed messages in the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DelayMessages
      DelaySeconds:
        Description: The delay time after which all messages that are sent to the queue can be consumed.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DelaySeconds
      MessageRetentionPeriod:
        Description: The maximum lifetime of a message in the queue. After the time that is specified by this parameter expires, the message is deleted, regardless of whether the message has been consumed.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - MessageRetentionPeriod
      InactiveMessages:
        Description: The total number of inactive messages in the queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - InactiveMessages
      QueueName:
        Description: The name of the MNS queue.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - QueueName
    
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "QueueName": {
          "Type": "String",
          "Description": {
            "en": "The name of the MNS queue."
          },
          "Required": true
        }
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::MNS::Queue",
          "Properties": {
            "QueueName": {
              "Ref": "QueueName"
            }
          }
        }
      },
      "Outputs": {
        "ActiveMessages": {
          "Description": "The total number of active messages in the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "ActiveMessages"
            ]
          }
        },
        "PollingWaitSeconds": {
          "Description": "The maximum time period that a ReceiveMessage request can wait till a message is in the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "PollingWaitSeconds"
            ]
          }
        },
        "MaximumMessageSize": {
          "Description": "The maximum size of a message that can be sent to the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "MaximumMessageSize"
            ]
          }
        },
        "CreateTime": {
          "Description": "The time when the queue was created.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "CreateTime"
            ]
          }
        },
        "VisibilityTimeout": {
          "Description": "The duration for which a message stays in the Inactive state after it is consumed from the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "VisibilityTimeout"
            ]
          }
        },
        "QueueInternalUrl": {
          "Description": "The internal URL of the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "QueueInternalUrl"
            ]
          }
        },
        "LastModifyTime": {
          "Description": "The most recent time when the queue was modified.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "LastModifyTime"
            ]
          }
        },
        "QueueUrl": {
          "Description": "The URL of the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "QueueUrl"
            ]
          }
        },
        "LoggingEnabled": {
          "Description": "Specifies whether to enable the log management feature.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "LoggingEnabled"
            ]
          }
        },
        "DelayMessages": {
          "Description": "The total number of delayed messages in the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DelayMessages"
            ]
          }
        },
        "DelaySeconds": {
          "Description": "The delay time after which all messages that are sent to the queue can be consumed.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DelaySeconds"
            ]
          }
        },
        "MessageRetentionPeriod": {
          "Description": "The maximum lifetime of a message in the queue. After the time that is specified by this parameter expires, the message is deleted, regardless of whether the message has been consumed.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "MessageRetentionPeriod"
            ]
          }
        },
        "InactiveMessages": {
          "Description": "The total number of inactive messages in the queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "InactiveMessages"
            ]
          }
        },
        "QueueName": {
          "Description": "The name of the MNS queue.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "QueueName"
            ]
          }
        }
      }
    }