ALIYUN::ROCKETMQ5::ConsumerGroup类型用于创建ROCKETMQ5.0系列的消费者分组。
语法
{
  "Type": "ALIYUN::ROCKETMQ5::ConsumerGroup",
  "Properties": {
    "ConsumerGroupId": String,
    "InstanceId": String,
    "ConsumeRetryPolicy": Map,
    "DeliveryOrderType": String,
    "Remark": String
  }
}属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| ConsumerGroupId | String | 是 | 否 | 待创建的消费者分组的ID。 | 用于标识消费者分组,全局唯一。 取值说明如下: 
 保留字符限制,请参见配额与限制。 | 
| InstanceId | String | 是 | 否 | 待创建的消费者分组所属的实例ID。 | 无 | 
| ConsumeRetryPolicy | Map | 是 | 是 | 待创建消费者分组的消费重试策略。 | 更多信息,请参见 消费重试。 | 
| DeliveryOrderType | String | 是 | 是 | 待创建消费者分组的投递顺序性。 | 取值: 
 | 
| Remark | String | 否 | 是 | 待创建消费者分组的备注信息。 | 无 | 
ConsumeRetryPolicy语法
"ConsumeRetryPolicy": {
  "RetryPolicy": String,
  "MaxRetryTimes": Integer,
  "DeadLetterTargetTopic": String
}ConsumeRetryPolicy属性
| 属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 | 
| RetryPolicy | String | 是 | 是 | 重试策略类型。 | 取值: 
 更多信息,请参见消费重试。 | 
| 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"
        ]
      }
    }
  }
}该文章对您有帮助吗?