Creates a group.

Usage notes

You can call this operation when new groups are required to publish new applications or implement business logic.

QPS limit

A user can perform a maximum of one query per second (QPS). When the number of calls to this operation per second exceeds the QPS limit, throttling is triggered. If throttling is triggered, your business may be affected. We recommend that you take note of the QPS limit on this operation. For more information, see QPS limit.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after these RAM users are granted related permissions. The following table describes the authorization information of this operation. For more information, see Policies and examples.

Operation

Action

Resource

OnsGroupCreate

mq:CreateGroup

acs:mq:*:*:{instanceId}

Request parameters

Parameter Type Required Example Description
Action String Yes OnsGroupCreate

The operation that you want to perform. Set the value to OnsGroupCreate.

GroupId String Yes GID_test_groupId

The ID of the group to be created. Take note of the following items:

  • The ID must be 2 to 64 characters in length and can contain letters, digits, hyphens (-), and underscores (_).
  • If the instance where the group to be created resides has a namespace, the ID of the group must be unique in the instance. Specifically, the ID cannot be the same as an existing group ID or topic name in the instance. Group IDs and topic names in different instances can be the same. For example, a group ID in Instance A can be the same as a group ID or topic name in Instance B.
  • If the instance where the group to be created resides has no namespace, the ID of the group must be globally unique across instances and regions. Specifically, the ID of the group cannot be the same as an existing group ID or topic name in Message Queue for Apache RocketMQ within your Alibaba Cloud account.
Note
  • The ID of a group cannot be modified after the group is created.
  • You can check whether an instance has a namespace in the Basic Information section on the Instance Details page in the Message Queue for Apache RocketMQ console.
Remark String No test

The description of the group.

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the instance where the group to be created resides.

GroupType String No tcp

The protocol that is applicable to the group to be created. All clients in a group communicate with brokers over the same protocol. A group cannot contain both TCP clients and HTTP clients. You must create different groups for TCP clients and HTTP clients. Valid values:

  • tcp: The group to be created publishes or subscribes to messages over TCP. This value is the default value.
  • http: The group to be created publishes or subscribes to messages over HTTP.

Response parameters

Parameter Type Example Description
RequestId String A07E3902-B92E-44A6-B6C5-6AA111111****

The ID of the request. This is a common parameter. Each request has a unique ID. This facilitates troubleshooting and fault locating.

Examples

Sample requests

http(s)://ons.cn-hangzhou.aliyuncs.com/?Action=OnsGroupCreate
&GroupId=GID_test_groupId
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Remark=test
&GroupType=tcp
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<OnsGroupCreateResponse>
<RequestId>A07E3902-B92E-44A6-B6C5-6AA111111****</RequestId>
</OnsGroupCreateResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, visit the API Error Center.

Operation in the Message Queue for Apache RocketMQ console

In addition to calling the OnsGroupCreate operation, you can create a group in the Message Queue for Apache RocketMQ console. For more information, see Manage groups.