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
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
rocketmq:CreateConsumerGroup |
create |
*ConsumerGroup
|
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:
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:
Valid values:
|
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:
Valid values:
|
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:
|
10 |
| maxReceiveTps |
integer |
No |
The maximum TPS for consuming messages. |
1000 |
| messageModel |
string |
No |
The subscribe pattern for consumers:
Valid values:
|
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.