All Products
Search
Document Center

Message Queue for Apache Kafka:GetTopicStatus

Last Updated:Nov 22, 2022

Queries the status information about messages in a specified topic.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

alikafka_pre-cn-v0h15tjm****
TopicstringYes

The name of the topic.

normal_topic_9d034262835916103455551be06cc****
RegionIdstringNo

The region ID of the instance.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object
Codeinteger

The HTTP status code returned. The HTTP status code 200 indicates that the request is successful.

200
Messagestring

The returned message.

operation success.
RequestIdstring

The ID of the request.

E475C7E2-8C35-46EF-BE7D-5D2A9F5D****
Successboolean

Indicates whether the request is successful.

true
TopicStatusobject

The status information about messages in the topic.

TotalCountlong

The number of messages in the topic.

423
LastTimeStamplong

The time when the last consumed message was generated. Unit: ms

1566470063575
OffsetTablearray

The information about offsets in the topic.

object
Partitioninteger

The ID of the partition.

0
MinOffsetlong

The earliest offset in the partition of the topic.

0
LastUpdateTimestamplong

The time when the partition was last modified. Unit: ms

1566470063547
MaxOffsetlong

The maximum offset in the partition.

76
Topicstring

The name of the topic.

testkafka

Example

Normal return example

JSONFormat

{
  "Code": 200,
  "Message": "operation success.",
  "RequestId": "E475C7E2-8C35-46EF-BE7D-5D2A9F5D****",
  "Success": true,
  "TopicStatus": {
    "TotalCount": 423,
    "LastTimeStamp": 1566470063575,
    "OffsetTable": [
      {
        "Partition": 0,
        "MinOffset": 0,
        "LastUpdateTimestamp": 1566470063547,
        "MaxOffset": 76,
        "Topic": "testkafka"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the API error center.