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 (1000 ms by default).
This API is out-of-date and may not be maintained in the future. Use the API described in Resetting Consumer Group Offset to the Specified Position.
Call Method
For details, see How to Call an API.
URI
POST /v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
instance_id | Yes | String | Instance ID. |
group | Yes | String | Consumer group name. |
Request Parameters
Parameter | Mandatory | Type | Description |
---|---|---|---|
topic | No | String | Topic name. |
partition | Yes | Integer | Partition number. The default value is -1, indicating that all partitions are reset. |
message_offset | No | Long | This parameter resets consumer group offset to the specified position.
Either message_offset or timestamp must be specified. |
timestamp | No | Long | This parameter resets consumer group offset to the specified time. The value is a UNIX timestamp, in millisecond.
Either message_offset or timestamp must be specified. |
Response Parameters
None
Example Requests
- A consumer group offset is reset to the specified position.POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset{"topic" : "test","partition" : 0,"message_offset" : 10}
- A consumer group offset is reset to the specified time.POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset{"topic" : "test","partition" : 0,"timestamp" : 1571812144000}
Example Response
None
Status Codes
Status Code | Description |
---|---|
204 | Successfully reset the consumer group offset to the specified position. |
Error Codes
See Error Codes.
- Function
- Call Method
- URI
- Request Parameters
- Response Parameters
- Example Requests
- Example Response
- Status Codes
- Error Codes