Creates a group ID.

Usage notes

You can call this operation when new group IDs are required to publish new applications or implement service logic.

QPS limit

The queries-per-second (QPS) limit on this operation is 1 per user. Throttling is triggered when the number of calls to this operation per second exceeds the QPS limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after they are authorized to use it. The following table lists the authorization information of this operation. For more information, see Policies and examples.

API

Action

Resource

OnsGroupCreate

mq:CreateGroup

acs:mq:*:*:{instanceId}

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

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 group ID that you want to create. Valid values:

  • The group ID must start with GID_ or GID- and can contain only letters, digits, hyphens (-), and underscores (_).
  • The group ID must be 5 to 64 bytes in length.
Note The group ID cannot be modified after it is created.
InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the instance where you want to create the group ID.

Remark String No test

The description of the group ID.

GroupType String No tcp

The protocol that is applicable to the group ID you want to create. A TCP-based instance cannot share a group ID with an HTTP-based instance. You must create a group ID for each of them. Valid values:

  • tcp: indicates that the group ID is applicable only to messages that are sent and received over TCP. This value is the default value.
  • http: indicates that the group ID is applicable only to messages that are sent and received over HTTP.

Response parameters

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

The ID of the request, which is a common parameter. Each request has a unique ID to facilitate 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

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

JSON format

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

Error codes

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

Operations in the console

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