Resetting Consumer Group Offset to the Specified Position
Function
Kafka instances do not support resetting the consumer offset online. Before resetting, stop the client for which the offset is to be reset.
After a client is stopped, the server considers the client offline only after the time period specified in ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG (10,000 ms by default).
URI
PUT /v2/{engine}/{project_id}/mqs/instances/{instance_id}/groups/{group_id}/reset-message-offset
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID |
instance_id |
Yes |
String |
Instance ID. |
engine |
Yes |
String |
Engine type. |
group_id |
Yes |
String |
Consumer group ID |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
topic |
Yes |
String |
Topic name. |
partition |
No |
Integer |
Partition number. The default value is -1, indicating that all partitions are reset. |
message_offset |
No |
Integer |
Resetting consumer group offset to the specified position.
If this offset is later than the current largest offset, the offset will be reset to the latest offset. Either message_offset or timestamp must be specified. |
timestamp |
No |
Integer |
Specified time that the offset is to be reset to. The value is a Unix timestamp, in millisecond. If this time is earlier than the current earliest timestamp, the offset will be reset to the earliest timestamp. If this time is later than the current largest timestamp, the offset will be reset to the latest timestamp. Either message_offset or timestamp must be specified. |
Response Parameters
Status code: 204
Parameter |
Type |
Description |
---|---|---|
- |
String |
- |
Example Requests
-
POST https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group_id}/reset-message-offset { "topic" : "test", "partition" : 0, "message_offset" : 10 }
-
POST https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group_id}/reset-message-offset { "topic" : "test", "partition" : 0, "timestamp" : 1571812144000 }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
204 |
Operation successful. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot