All Products
Search
Document Center

ApsaraMQ for RocketMQ:CreateConsumerGroup

Last Updated:Sep 24, 2026

Creates a consumer group (ConsumerGroup) for ApsaraMQ for RocketMQ. A consumer group is a load balancing group in ApsaraMQ for RocketMQ that contains multiple consumers with consistent consumption behavior. Consumers must subscribe to related topics by specifying a consumer group to implement message subscription.

Operation description

Important The OpenAPI operations provided by Alibaba Cloud are management APIs used to manage and query Alibaba Cloud service resources. Use these operations only in the management link. Do not use them in the core data link for sending and receiving messages, as this may introduce risks to the link.

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 instance ID of the instance to which the consumer group to be created belongs.

rmq-cn-7e22ody****

consumerGroupId

string

Yes

The ID of the consumer group to be created. Used as the identity of the consumer group, which is globally unique.

Valid values:

  • Character restrictions: letters a~z or A~Z, digits 0~9, underscores (_), and hyphens (-).

  • Length restrictions: 1 to 60 characters.

For reserved word restrictions, see Parameter limits.

GID_test_groupId

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body object.

remark

string

No

The remarks for the consumer group to be created.

This is the remark for test.

deliveryOrderType

string

Yes

The delivery order type of the consumer group to be created.

Valid parameter values:

  • Concurrently: concurrent delivery

  • Orderly: ordered delivery

Valid values:

  • Concurrently :

    Concurrent delivery

  • Orderly :

    Ordered delivery

Concurrently

consumeRetryPolicy

object

Yes

The consumption retry policy of the consumer group to be created. For more information, see Consumption retry.

maxRetryTimes

integer

No

The maximum number of retry attempts.

16

retryPolicy

string

Yes

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

Valid parameter values:

  • FixedRetryPolicy: fixed-interval retry, supported only for ordered delivery

  • DefaultRetryPolicy: progressive backoff retry, supported only for concurrent delivery

Valid values:

  • FixedRetryPolicy :

    Fixed-interval retry

  • DefaultRetryPolicy :

    Progressive backoff retry

DefaultRetryPolicy

deadLetterTargetTopic

string

No

The dead-letter topic.

If a consumer fails to consume a message and the message still failed after retries, the message is delivered to the dead-letter topic for subsequent business recovery or backtracking. For more information, see Consumption retry and dead-letter messages.

DLQ_mqtest

fixedIntervalRetryTime

integer

No

The fixed retry interval, in seconds. This parameter takes effect when the retry policy is set to FixedRetryPolicy.

Valid values:

  • Concurrent delivery: 10 to 1800

  • Ordered delivery: 1 to 600

10

maxReceiveTps

integer

No

The maximum TPS for consuming messages.

1000

messageModel

string

No

The subscribe pattern for consumers:

  • CLUSTERING: clustering consumption pattern. All consumers in the ConsumerGroup share the same subscription.

  • LITE_SELECTIVE: lightweight consumption pattern. Consumers in the ConsumerGroup can have different subscriptions.

Valid values:

  • CLUSTERING :

    Clustering consumption pattern

  • LITE_SELECTIVE :

    Lightweight consumption pattern

LITE_SELECTIVE

topicName

string

No

The name of the lite-type topic to subscribe to when using the LITE_SELECTIVE consumption pattern.

liteTopicTest

exclusive

boolean

No

Specifies whether to enable exclusive subscription, which means a LiteTopic can only be subscribed to by one consumer. Set to true to enable or false to shutdown.

Response elements

Element

Type

Description

Example

object

Result

requestId

string

The request ID. Each request has a unique ID that is active and can be used to troubleshoot and locate issues.

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

success

boolean

Indicates whether the execute operation was successful.

true

data

boolean

The returned result.

true

code

string

The fault code.

InvalidConsumerGroupId

message

string

The fault message.

Parameter consumerGroupId is invalid.

httpStatusCode

integer

The HTTP status code.

400

dynamicCode

string

The dynamic fault code.

ConsumerGroupId

dynamicMessage

string

The dynamic fault 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.