Resetting Consumer Group Offset to the Specified Position
This API is out-of-date and may not be maintained in the future. Please use the API described in Resetting Consumer Group Offset to the Specified Position.
Prerequisites
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
POST /v1.0/{project_id}/instances/{instance_id}/manage/groups/{group}/reset-message-offset
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Project ID. |
| instance_id | String | Yes | Instance ID. |
| group | String | Yes | Consumer group name. |
Request
Request parameters
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| topic | String | Yes | Topic name. |
| partition | Integer | No | Partition number. The default value is -1, indicating that all partitions are reset. |
| message_offset | Long | No. Use either of these two parameters. | Specified position that the offset is to be reset to. If this position is earlier than the current earliest offset, the offset will be reset to the earliest offset. If this offset is later than the current largest offset, the offset will be reset to the latest offset. |
| timestamp | Long | Specified time that the offset is to be reset to, in Unix timestamp. 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. |
Example request 1
{
"topic": "test",
"partition": 0,
"message_offset": 10
} Example request 2
{
"topic": "test",
"partition": 0,
"timestamp": 1571812144
} Response
Response parameters
None.
Example response
None.
Status Code
The following table describes the status code for successful operations.
| Status Code | Description |
|---|---|
| 204 | Successfully reset consumer group offset to the specified position. |
Last Article: Querying Consumer Group Details
Next Article: Querying Controller Details for All Consumer Groups of a Kafka Instance
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.