This API is used to query the offset of the latest message in a partition.
GET /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/end-message
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain it, see Obtaining a Project ID. |
instance_id |
Yes |
String |
Instance ID. |
topic |
Yes |
String |
Topic name. A topic name must start with a letter and can only contain letters, hyphens (-), underscores (_), and digits. |
partition |
Yes |
Integer |
Partition number. |
None
Status code: 200
Parameter |
Type |
Description |
---|---|---|
topic |
String |
Topic name. |
partition |
Integer |
Partition number. |
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. |
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/end-message
Status code: 200
The offset of the latest message in a partition is queried successfully.
{ "topic" : "mytest", "partition" : 0, "offset" : 9, "timestamp" : 1568125039164 }
Status Code |
Description |
---|---|
200 |
The offset of the latest message in a partition is queried successfully. |
See Error Codes.