All Products
Search
Document Center

ApsaraMQ for RocketMQ:CreateConsumerGroup

Last Updated:Nov 06, 2025

Creates a consumer group for ApsaraMQ for RocketMQ. A consumer group is a load balancing group that contains multiple consumers with the same consumption behavior. Consumers must specify a consumer group and the relevant topics to subscribe to messages.

Operation description

Important The Alibaba Cloud OpenAPI is a management API used to manage and query Alibaba Cloud service resources. Integrate this API for management purposes only. Do not use this API for core data links that send and receive messages. This can introduce risks to your data links.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rocketmq:CreateConsumerGroup

create

*ConsumerGroup

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}/consumergroup/{#ConsumerGroupId}

None None

Request syntax

POST /instances/{instanceId}/consumerGroups/{consumerGroupId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The ID of the instance to which the consumer group belongs.

rmq-cn-7e22ody****

consumerGroupId

string

Yes

The ID of the consumer group that you want to create. This ID is used to identify the consumer group and must be globally unique.

The value must meet the following requirements:

  • The ID can contain letters, digits, underscores (_), and hyphens (-).

  • The ID must be 1 to 60 characters in length.

For more information about reserved characters, see Parameter limits.

GID_test_groupId

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

remark

string

No

The remarks on the consumer group.

This is the remark for test.

deliveryOrderType

string

Yes

The delivery order of the consumer group.

Valid values:

  • Concurrently: Messages are delivered concurrently.

  • Orderly: Messages are delivered in order.

Valid values:

  • Concurrently :

    Concurrent delivery

  • Orderly :

    Orderly delivery

Concurrently

consumeRetryPolicy

object

Yes

The retry policy for the consumer group. For more information, see Message retry.

maxRetryTimes

integer

No

The maximum number of retries.

16

retryPolicy

string

Yes

The type of the retry policy. For more information, see Message retry.

Valid values:

  • FixedRetryPolicy: retries at a fixed interval. This policy is available only for orderly message delivery.

  • DefaultRetryPolicy: retries with a backoff. This policy is available only for concurrent message delivery.

Valid values:

  • FixedRetryPolicy :

    Fixed-interval retry

  • DefaultRetryPolicy :

    Backoff retry

DefaultRetryPolicy

deadLetterTargetTopic

string

No

The dead-letter topic.

If a consumer fails to consume a message after the maximum number of retries, the message is delivered to a dead-letter topic. You can then perform business recovery or backtrace the message. For more information, see Message retry and dead-letter messages.

DLQ_mqtest

fixedIntervalRetryTime

integer

No

The fixed retry interval. Unit: seconds. This parameter is valid only if you set the retry policy to FixedRetryPolicy. Valid values:

  • Concurrent delivery: 10 to 1800

  • Orderly delivery: 1 to 600

10

maxReceiveTps

integer

No

The maximum TPS for message consumption.

1000

messageModel

string

No

The consumption mode. Valid values:

  • CLUSTERING

  • LITE_SELECTIVE

LITE_SELECTIVE

topicName

string

No

The name of the lite topic that the consumer group subscribes to. This parameter is required if you set messageModel to LITE_SELECTIVE.

liteTopicTest

Response elements

Element

Type

Description

Example

object

Result<boolean>

requestId

string

The request ID. Each request has a unique ID. You can use this ID to troubleshoot and locate issues.

AF9A8B10-C426-530F-A0DD-96320B39****

success

boolean

Indicates whether the call was successful.

true

data

boolean

The data returned.

true

code

string

The error code.

InvalidConsumerGroupId

message

string

The error message.

Parameter consumerGroupId is invalid.

httpStatusCode

integer

The HTTP status code.

400

dynamicCode

string

The dynamic error code.

ConsumerGroupId

dynamicMessage

string

The dynamic error message.

consumerGroupId

Examples

Success response

JSON format

{
  "requestId": "AF9A8B10-C426-530F-A0DD-96320B39****",
  "success": true,
  "data": true,
  "code": "InvalidConsumerGroupId",
  "message": "Parameter consumerGroupId is invalid.",
  "httpStatusCode": 400,
  "dynamicCode": "ConsumerGroupId",
  "dynamicMessage": "consumerGroupId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.