Querying a Message with a Specified Offset
Function
This API is used to query a message with a specified offset.
Debugging
You can use API Explorer to debug this API.
URI
GET /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/partitions/{partition}/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. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| message_offset | Yes | String | Message offset. |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| message | Array of ShowPartitionMessageEntity objects | Message list. |
| Parameter | Type | Description |
|---|---|---|
| key | String | Message key. |
| value | String | Message content. |
| topic | String | Topic name. |
| partition | Integer | Partition ID. |
| message_offset | Long | Message offset. |
| size | Integer | Message size in bytes. |
| 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}/message?message_offset={message_offset} Example Responses
Status code: 200
The message with the specified offset is queried successfully.
{
"message" : [ {
"topic" : "mytest",
"partition" : 0,
"message_offset" : 7,
"key" : null,
"value" : "kasjdf",
"size" : 6,
"timestamp" : 1568125036045
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The message with the specified offset is queried successfully. |
Error Codes
See Error Codes.
Last Article: Querying Messages
Next Article: Querying a Message with a Specified Time Period
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.