Resets the consumer offset of a consumer group. If you reset a consumer offset, the offset from which a consumer starts to consume messages is changed. If faults occur or wrong messages are consumed during message consumption, you can reset the consumer offset to roll back the consumption to a specific offset for reconsumption. You can also reset the consumer offset to the latest offset and temporarily leave the accumulated messages unhandled.
Debugging
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| rocketmq:ResetConsumeOffset | update | *ConsumerGroup acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}/consumergroup/{#ConsumerGroupId} |
| none |
Request syntax
PATCH /instances/{instanceId}/consumerGroups/{consumerGroupId}/consumeOffsets/{topicName} HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| instanceId | string | Yes | The instance ID. | rmq-cn-tl32ue44x0g |
| consumerGroupId | string | Yes | The consumer group ID. | dolphin_status |
| topicName | string | Yes | The topic name. | AMZN_REPORT_TOPIC |
| body | object | No | The request body. | |
| resetType | string | No | The method that is used to reset the consumer offset. Valid values: LATEST_OFFSET and SPECIFIED_TIME. | LATEST_OFFSET |
| resetTime | string | No | The time when the consumer offset is reset. | 2023-03-22 12:17:08 |
Response parameters
Examples
Sample success responses
JSONformat
{
"requestId": "F9A95891-EAD4-5A2B-8A30-676CD18921AF",
"success": true,
"code": "MissingInstanceId",
"message": "The instance cannot be found.",
"httpStatusCode": 200,
"dynamicCode": "InstanceId",
"dynamicMessage": "instanceId"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|
