A subscription includes a Message Service (MNS) topic that is subscribed and an endpoint that is used to receive messages. You can call the Subscribe operation to create a subscription. After the subscription is created, you can publish messages to the topic and MNS pushes the messages to the specified endpoint. If the endpoint is invalid, the messages fail to be pushed. In this case, MNS retries to push messages based on the specified retry policy. If the retries fail, the messages are discarded.
The syntax of the subscription URL is
mns. <Region>.aliyuncs.com: the endpoint that is used to access MNS.
Region indicates the region where MNS is deployed. To view the endpoint of MNS in a region, log on to the MNS console and click Get Endpoint in the upper-right corner.
AccountId: the account ID of the topic owner.
When you call MNS API operations, replace the value with the ID of your Alibaba Cloud account.
TopicName: the name of the topic.
When you call MNS API operations, replace the value with the actual topic name.
SubscriptionName: the name of the subscription.
When you call MNS API operations, replace the value with the actual subscription name. The subscription name must be unique in the topic.
- The endpoint that is used to receive messages from the topic.
- Supported endpoints include MNS queues.
- The tag that is used to filter messages.
- Data type: string.
- If you specify this parameter, MNS pushes only the messages that are attached with the specified tags.
- The retry policy that is applied if a message fails to be pushed.
- Valid values: BACKOFF_RETRY and EXPONENTIAL_DECAY_RETRY.
- If a message fails to be pushed, MNS retries to push the message based on the specified
retry policy. If the retries fail, MNS discards the message and continues to push
the next message.
For more information about the retry policy, see NotifyStrategy.
- The format of the message that is pushed to the endpoint.
- Valid values: XML and SIMPLIFIED.
For more information about the message format, see NotifyContentFormat.
- The time when the subscription was created. The value is a timestamp that follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.
- The time when the subscription was last modified. The value is a timestamp that follows the UNIX time format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.