全部產品
Search
文件中心

:ALIYUN::ROCKETMQ5::ConsumerGroup

更新時間:Mar 27, 2025

ALIYUN::ROCKETMQ5::ConsumerGroup類型用於建立ROCKETMQ5.0系列的消費者分組。

文法

{
  "Type": "ALIYUN::ROCKETMQ5::ConsumerGroup",
  "Properties": {
    "ConsumerGroupId": String,
    "InstanceId": String,
    "ConsumeRetryPolicy": Map,
    "DeliveryOrderType": String,
    "Remark": String
  }
}

屬性

屬性名稱

類型

必須

允許更新

描述

約束

ConsumerGroupId

String

待建立的消費者分組的ID。

用於標識消費者分組,全域唯一。

取值說明如下:

  • 字元限制:支援字母a~z或A~Z、數字0~9以及底線(_)、短劃線(-)和百分比符號(%)。

  • 長度限制:1~60個字元。

InstanceId

String

待建立的消費者分組所屬的執行個體ID。

ConsumeRetryPolicy

Map

待建立消費者分組的消費重試策略。

DeliveryOrderType

String

待建立消費者分組的投遞順序性。

取值:

  • Concurrently:並發投遞。

  • Orderly:順序投遞。

Remark

String

待建立消費者分組的備忘資訊。

ConsumeRetryPolicy文法

"ConsumeRetryPolicy": {
  "RetryPolicy": String,
  "MaxRetryTimes": Integer,
  "DeadLetterTargetTopic": String
}

ConsumeRetryPolicy屬性

屬性名稱

類型

必須

允許更新

描述

約束

RetryPolicy

String

重試策略類型。

取值:

  • FixedRetryPolicy:固定間隔重試。

  • DefaultRetryPolicy:階梯退避重試。

MaxRetryTimes

Integer

最大重試次數。

DeadLetterTargetTopic

String

死信 Topic。

消費者出現異常消費某條訊息失敗,且訊息重試後依然未成功,訊息將被投遞至死信 Topic 中,以便後續進行業務恢複或回溯。更多資訊,請參見消費重試

傳回值

Fn::GetAtt

  • ConsumerGroupId:消費者分組的ID。

  • InstanceId:消費者分組所屬的執行個體ID。

  • DeliveryOrderType:待建立消費者分組的投遞順序性。

樣本

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ConsumerGroupId:
    Type: String
    Description: |-
      The ID of the consumer group to be created. Used to identify consumer groups, globally unique.
      The value description is as follows:
      Character limitation: supports letters a~z or A-Z, numbers 0-9, underscore (_), dash (-) and percent sign (%).
      Length limit: 1-60 characters.
    MinLength: 1
    MaxLength: 60
  InstanceId:
    Type: String
    Description: The ID of the instance.
Resources:
  ConsumerGroup:
    Type: ALIYUN::ROCKETMQ5::ConsumerGroup
    Properties:
      ConsumerGroupId:
        Ref: ConsumerGroupId
      InstanceId:
        Ref: InstanceId
      ConsumeRetryPolicy:
        RetryPolicy: DefaultRetryPolicy
        MaxRetryTimes: 5
      DeliveryOrderType: Concurrently
Outputs:
  ConsumerGroupId:
    Description: The ID of the consumer group.
    Value:
      Fn::GetAtt:
        - ConsumerGroup
        - ConsumerGroupId
  InstanceId:
    Description: The ID of the instance.
    Value:
      Fn::GetAtt:
        - ConsumerGroup
        - InstanceId
  DeliveryOrderType:
    Description: Delivery sequence of consumer group.
    Value:
      Fn::GetAtt:
        - ConsumerGroup
        - DeliveryOrderType
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ConsumerGroupId": {
      "Type": "String",
      "Description": "The ID of the consumer group to be created. Used to identify consumer groups, globally unique.\nThe value description is as follows:\nCharacter limitation: supports letters a~z or A-Z, numbers 0-9, underscore (_), dash (-) and percent sign (%).\nLength limit: 1-60 characters.",
      "MinLength": 1,
      "MaxLength": 60
    },
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the instance."
    }
  },
  "Resources": {
    "ConsumerGroup": {
      "Type": "ALIYUN::ROCKETMQ5::ConsumerGroup",
      "Properties": {
        "ConsumerGroupId": {
          "Ref": "ConsumerGroupId"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "ConsumeRetryPolicy": {
          "RetryPolicy": "DefaultRetryPolicy",
          "MaxRetryTimes": 5
        },
        "DeliveryOrderType": "Concurrently"
      }
    }
  },
  "Outputs": {
    "ConsumerGroupId": {
      "Description": "The ID of the consumer group.",
      "Value": {
        "Fn::GetAtt": [
          "ConsumerGroup",
          "ConsumerGroupId"
        ]
      }
    },
    "InstanceId": {
      "Description": "The ID of the instance.",
      "Value": {
        "Fn::GetAtt": [
          "ConsumerGroup",
          "InstanceId"
        ]
      }
    },
    "DeliveryOrderType": {
      "Description": "Delivery sequence of consumer group.",
      "Value": {
        "Fn::GetAtt": [
          "ConsumerGroup",
          "DeliveryOrderType"
        ]
      }
    }
  }
}