A subscription includes an MNS topic that is subscribed and an endpoint for receiving messages. You can use the Subscribe API operation to create a subscription. After the subscription is created, MNS automatically pushes new messages that are sent to the topic to the specified endpoint. If the endpoint is invalid, message pushing fails. In this case, MNS retries to push messages based on the specified retry policy. If the retries fail, the messages are discarded.

SubscriptionURL
  • The syntax of the subscription URL: http://$AccountId.mns. <Region>.aliyuncs.com/topic/$TopicName/subscriptions/$SubscriptionName
  • mns. <Region>.aliyuncs.com: the endpoint that is used to access MNS. You must replace Region with the ID of the region in which MNS is deployed. If you want to view the endpoint of MNS in a region, go to the MNS console and click Get Endpoint in the upper-right corner of the console.

  • AccountId: the account ID of the topic owner.
  • TopicName: the name of the topic.
  • SubscriptionName: the name of the subscription. When you create multiple subscriptions to a single topic, each subscription name must be unique.

Related parameters

Endpoint
  • The endpoint that is used to receive messages.
  • Supported endpoints include HTTP URLs, MNS queues, and email addresses.
FilterTag
  • The tag that is used to filter messages.
  • The data type of this parameter is string.
  • If you specify this parameter, MNS only pushes filtered messages to endpoints.
NotifyStrategy
  • The retry policy when message pushing fails.
  • Valid values: BACKOFF_RETRY and EXPONENTIAL_DECAY_RETRY.
  • When message pushing fails, MNS retries to push messages based on the specified retry policy. If the retries fail, MNS discards the messages and continue to push other messages.
  • For more information about the retry policy, see NotifyStrategy.
NotifyContentFormat
  • The content format of the message that is pushed to the endpoint.
  • Valid values: XML and SIMPLIFIED.
  • For more information about the message content format, see NotifyContentFormat.
CreateTime
The time when the subscription was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
LastModifyTime
The time when the subscription was last modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.