tencent cloud

文档反馈

Get topic attribute

最后更新时间:2024-12-18 17:45:20
    Note:
    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new CMQ API 3.0 which is standardized and faster.

    Interface description

    This API (GetTopicAttributes) is used to obtain the attributes of a created topic. In addition to the settable property set when topic was created, you can also get the creation time of topic, the time of the last modification of topic attribute, and the Statistics (approximate value) of the message in topic.
    Domain name requested by public network API: https://cmq-topic-{$region}.api.qcloud.com
    Domain name requested by private network API: http://cmq-topic-{$region}.api.tencentyun.com
    The above {$region} in the domain name needs to be replaced with a specific region : gz (Guangzhou), sh (Shanghai), bj (Beijing), shjr (Shanghai Financial), szjr (Shenzhen Financial), hk (China Hong Kong), cd (Chengdu), ca (North American), usw (Maxi), sg (Singapore). The region value in the common parameters should be consistent with the region value of the domain name. If there is any inconsistency, the request will be sent to the region specified by the domain name region based on the region value of the domain name.
    Note:
    At any time (including during internal testing), if the public network downstream Traffic is generated by using a public network domain name, Traffic and cost will be charged. Therefore, users of the service on Tencent Cloud are strongly recommended to use it. Private network Domain name, private network will not produce Traffic cost.

    Input Parameter

    The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters Document.
    Parameter name
    Required
    Type
    Description
    TopicName
    Yes
    String
    Topic's name is unique under the same account in a single region. Topic's name is a string of no more than 64 characters, which must begin with a letter, and the rest can contain letters, numbers and underscores. -## Output Parameter
    Parameter name
    Type
    Description
    Code
    Int
    0: indicates success. 4440: topic does not exist. The meaning of other return values can be referenced. Error Codes Document
    Message
    String
    Error message
    RequestId
    String
    Request ID generated by the server. When an internal error occurs on the server, the user can submit this ID to Backend Background to locate the problem.
    MsgCount
    Int
    Current number of messages in this topic (number of Message Retention)
    MaxMsgSize
    Int
    Max Message Length. Value range: 1024-1048576Byte (that is, 1-1024K). The default value is 65536.
    MsgRetentionSeconds
    Int
    The longest survival time of a message in topic will be deleted in seconds after the time specified by this parameter has elapsed since it was sent to topic, regardless of whether the message was successfully pushed to the user. Fixed to one day (86400 seconds), this property cannot be modified
    CreateTime
    Int
    The founding time of topic. Return Unix timestamp, accurate to seconds
    LastModifyTime
    Int
    The time when the topic attribute was last modified. Returns Unix timestamp, accurate to seconds.
    FilterType
    Int
    Describes the filtering policy that the user chooses when creating a subscription:
    FilterType = 1 indicates that the user uses filterTag tag filtering
    FilterType = 2 indicates that the user uses bindingKey filtering.
    CreateUin
    Int
    The creator Uin,CAM authentication resource is composed of this field.
    QPS
    Int
    The number of publish messages per second.
    TopicId
    String
    Topic's ID.

    Example

    Enter:
    https://domain/v2/index.php?Action=GetTopicAttributes
    &topicName=test-topic-123
    &<Common request parameters>
    Output:
    {
    "code": 0,
    "message": "",
    "codeDesc": "Success",
    "requestId": "2074225773",
    "msgCount": 0,
    "maxMsgSize": 65536,
    "msgRetentionSeconds": 86400,
    "createTime": 1563368086,
    "lastModifyTime": 1564576253,
    "createUin": 100008950635,
    "qps": 5000,
    "topicId": "topic-kalspsqc",
    "filterType": 1,
    "tags": []
    }