All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsGroupCreate

Last Updated:Mar 03, 2024

Creates a consumer group.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.

When you release a new application or implement new business logic, you need new consumer groups. You can call this operation to create a consumer group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mq:CreateGroupWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
GroupIdstringYes

The ID of the consumer group that you want to create. The group ID must meet the following rules:

  • The group ID must be 2 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_).
  • If the ApsaraMQ for RocketMQ instance in which you want to create the consumer group uses a namespace, the group ID must be unique in the instance. The group ID cannot be the same as an existing group ID or a topic name in the instance. The group ID can be the same as a group ID or a topic name in another instance that uses a different namespace. For example, if Instance A and Instance B use different namespaces, a group ID in Instance A can be the same as a group ID or a topic name in Instance B.
  • If the instance does not use a namespace, the group ID must be globally unique across instances and regions. The group ID cannot be the same as an existing group ID or topic name in ApsaraMQ for RocketMQ instances that belong to your Alibaba Cloud account.
Note
  • After the consumer group is created, the group ID cannot be changed.

  • To check whether an instance uses a namespace, log on to the ApsaraMQ for RocketMQ console, go to the Instance Details page, and then view the value of the Namespace field in the Basic Information section.

GID_test_groupId
RemarkstringNo

The description of the consumer group.

test
InstanceIdstringYes

The ID of the instance in which you want to create the consumer group.

MQ_INST_111111111111_DOxxxxxx
GroupTypestringNo

The protocol over which clients in the consumer group communicate with the ApsaraMQ for RocketMQ broker. All clients in a consumer group communicate with the ApsaraMQ for RocketMQ broker over the same protocol. You must create different groups for TCP clients and HTTP clients. Valid values:

  • tcp: Clients in the consumer group consume messages over TCP. This is the default value.
  • http: Clients in the consumer group consume messages over HTTP.
tcp

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

RequestIdstring

The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

A07E3902-B92E-44A6-B6C5-6AA111111****

Examples

Sample success responses

JSONformat

{
  "RequestId": "A07E3902-B92E-44A6-B6C5-6AA111111****"
}

Error codes

HTTP status codeError codeError message
400%s%s, please check and retry later

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-10-07The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change

Create a consumer group in the console

You can also create a consumer group in the ApsaraMQ for RocketMQ console.**** For more information, see Manage groups.