Resets a consumer offset to a specified timestamp for a consumer group.
Operation description
Alibaba Cloud API operations are designed for resource management only. Do not use them in the core messaging data path. Otherwise, system risks may occur.
Use this operation to clear accumulated messages or reset a consumer offset to a specified timestamp. Two clearing methods are available:
-
Clear all accumulated messages in a topic.
-
Clear messages published before a specified point in time.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:ResetConsumerOffset |
get |
Topic
Topic
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| GroupId |
string |
Yes |
The consumer group ID whose dead-letter messages you want to query. |
GID_test_consumer_id |
| Topic |
string |
Yes |
The topic for which to reset the consumer offset. |
test-mq-topic |
| Type |
integer |
Yes |
The method to clear accumulated messages. Valid values:
If "reconsumeLater" is returned, accumulated messages are not cleared because the system is retrying to resend messages to consumers.
The specified time must fall between the earliest and latest message publish times for the topic. Values outside this range are invalid. |
1 |
| ResetTimestamp |
integer |
No |
The timestamp to reset the consumer offset to. Takes effect only when Type is set to 1. Unit: milliseconds. |
1591153871000 |
| InstanceId |
string |
No |
The instance ID that the consumer group belongs to. |
MQ_INST_111111111111_DOxxxxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. This is a common parameter. Each request has a unique ID that you can use for troubleshooting. |
D52C68F8-EC5D-4294-BFFF-1A6A25AF**** |
Examples
Success response
JSON format
{
"RequestId": "D52C68F8-EC5D-4294-BFFF-1A6A25AF****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.