Querying Offset of the Earliest Message in a Partition
Function
This API is used to query the offset of the earliest message in a partition.
Debugging
You can use API Explorer to debug this API.
URI
GET /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/beginning-message
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| instance_id | Yes | String | Instance ID. |
| topic | Yes | String | Topic name. |
| partition | Yes | Integer | Partition number. |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| topic | String | Topic name. |
| partition | Integer | Partition number. |
| message_offset | Integer | Offset of the latest message. |
| timestamp | Long | Time when a message is created. The value is a Unix timestamp. The unit is millisecond. |
Example Requests
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/beginning-message Example Responses
Status code: 200
The offset of the earliest message in a partition is queried successfully.
{
"topic" : "mytest",
"partition" : 0,
"message_offset" : 9,
"timestamp" : 1568125039164
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The offset of the earliest message in a partition is queried successfully. |
Error Codes
See Error Codes.
Last Article: Querying a Message with a Specified Time Period
Next Article: Querying Offset of the Latest Message in a Partition
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.