You can call this operation to create a consumer group ID.

The group ID is used to publish and subscribe to messages.

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 ID of the consumer group that you want to create. The value must meet the following requirements:

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

The ID of the Message Queue for Apache RocketMQ instance corresponding to the group ID that you want to create.

Remark String No test

The description of the group ID that you want to create.

GroupType String No tcp

The protocol that is applicable to the group ID that you want to create. TCP-based instances cannot be located in the same group with HTTP-based instances. You must create group IDs for TCP-based instances and for HTTP-based instances separately. Valid values:

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

Response parameters

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

The ID of the request. This is a common parameter.

Examples

Sample requests

http(s)://[Endpoint]/? 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-6AA1111111799</RequestId>
</OnsGroupCreateResponse>

JSON format

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

Error codes

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