All Products
Search
Document Center

Message Service:Topic

Last Updated:Dec 22, 2023

A Message Service (MNS) topic is a destination to which messages are published. You can call the PublishMessage operation to publish messages to a topic.

TopicURL

The URL of an MNS topic. Format: http://$AccountId.mns.<Region>.aliyuncs.com/topics/$TopicName.

  • <Region>.aliyuncs.com: the endpoint of MNS.

    Replace <Region> with the ID of the region where the topic resides. To view the endpoint of MNS, go to the MNS console and click Get Endpoint in the upper-right corner.

  • AccountId: the account ID of the topic owner.

    Replace AccountId with the ID of the Alibaba Cloud account that is used to call MNS API operations. For more information, see Overview.

  • TopicName: the name of the topic.

    Replace TopicName with the name of an actual MNS topic. In a region, each topic name within an Alibaba Cloud account must be unique.

Parameters

  • MaximumMessageSize

    • The maximum size of the message body. Unit: bytes.

    • Valid values: 1024 to 65536.

    • If the size of the message body exceeds the upper limit, the message fails to be published to the topic.

  • LoggingEnabled

    • Specifies whether to enable the log management feature for the topic. Valid values:

    • Valid values: True and False.

    • If you set this parameter to True, MNS pushes the operation logs of the topic to a specified Object Storage Service (OSS) bucket or a specified Logstore. For more information, see Log management.

  • CreateTime

    The time when the topic was created. The value is a timestamp that follows the UNIX time format. It is the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970.

  • LastModifyTime

    The time when the topic was last modified. The value is a timestamp that follows the UNIX time format. It is the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970.

  • MessageRetentionPeriod

    • The maximum period for which a message can be retained in the topic. Unit: seconds.

    • A message that is published to the topic can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is pushed to the specified endpoints.

  • MessageCount

    • The number of messages in the topic.

    • These messages include messages that have been pushed to subscribers, but exclude messages that have expired and have been deleted.