All Products
Search
Document Center

Simple Message Queue (formerly MNS):Subscription

Last Updated:Jun 08, 2026

Subscriptions define how consumers receive messages from topics in Simple Message Queue (formerly MNS).

Definition and model relationship

In Simple Message Queue (formerly MNS), a subscription is a rule that a consumer registers on a topic to receive messages. Associate a topic with one or more subscriptions to customize push rules and delivery targets.

The following figure shows how subscriptions fit into the messaging model of Simple Message Queue (formerly MNS).

image

Features

  • Multiple subscription types: A topic can have multiple subscriptions. Each subscription corresponds to a different endpoint type.

  • Multiple subscriptions for messages: A topic can have multiple subscriptions, and each subscription receives all messages from that topic.

Subscription properties

Subscription name

  • Definition: Identifies the subscription. Must be unique per subscriber and topic.

  • Value: A string of up to 255 characters. The name must start with a letter and can contain letters, digits, and hyphens (-).

Subscription type

  • Definition: The type of endpoint that subscribes to messages.

  • Values: Queue, HTTP service, Short Message Service, Direct Mail, and Mobile Push. Subscription types.

Note

Push rate limits (TPS) vary by subscription type:

  • Standard queue subscription: The default push limit is 20,000 TPS.

  • HTTP(S) service subscription: The default push limit is 2,000 TPS.

Exceeding these limits triggers throttling, which may delay message delivery. To increase limits, submit a ticket.

Endpoint

  • Definition: The endpoint that receives messages.

  • Value:

    • If the Subscription type is set to HTTP, enter an HTTP address that starts with http:// or https://.

    • If the Subscription type is set to queue, enter the queue name.

    • If the Subscription type is set to Short Message Service, enter the phone number.

    • If the Subscription type is set to mailbox, enter the email address.

    • If the Subscription type is set to mobile terminal, enter the AppKey.

Message filtering tag

  • Definition: A tag used to filter messages delivered to this subscription. Message filtering.

  • Value: A string of up to 16 characters. Currently, only one tag is supported.

Retry policy (NotifyStrategy)

  • Definition: Specifies the retry policy when a message push to an endpoint fails. On failure, Simple Message Queue (formerly MNS) retries based on the policy. After all retries are exhausted, Simple Message Queue (formerly MNS) discards the message and moves to the next one.

  • Values:

    • BACKOFF_RETRY: The message push is retried 3 times. The interval between retries is a random value from 10 to 20 seconds.

    • EXPONENTIAL_DECAY_RETRY: The message push is retried 176 times over a total duration of 1 day. The retry interval increases exponentially from 1 second to a maximum of 512 seconds. The specific retry intervals are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, followed by 166 retries at an interval of 512 seconds.

Message format (NotifyContentFormat)

  • Definition: Specifies the format of messages pushed to the endpoint.

  • Values:

    • SIMPLIFIED: The message body contains only the published content, without message attributes. Example:

      {1:"a", 2:"b"}
    • JSON: The message body is in JSON format and includes both content and attributes. Example:

      {
          "TopicOwner":"TopicOwner",
          "TopicName":"TopicName",
          "Subscriber":"Subscriber",
          "SubscriptionName":"SubscriptionName",
          "MessageId":"6CC4D900CA59A2CD-1-15180534A8F-20000****",
          "Message":"xxxxx",
          "MessageMD5":"F1E92841751D795AB325861034B5****",
          "MessageTag":"important",
          "PublishTime":"1449556920975"
      }
    • XML: The message body is in XML format and includes both content and attributes. Example:

      <?xml version="1.0" encoding="utf-8"?>
          <Notification xlmns="http://mns.aliyuncs.com/doc/v1/">
              <TopicOwner>TopicOwner</TopicOwner>
              <TopicName>TopicName</TopicName>
              <Subscriber>Subscriber</Subscriber>
              <SubscriptionName>SubscriptionName</SubscriptionName>
              <MessageId>6CC4D900CA59A2CD-1-15180534A8F-20000****</MessageId>
              <Message>{1:"a", 2:"b"}</Message>
              <MessageMD5>F1E92841751D795AB325861034B5****</MessageMD5>
              <MessageTag>important</MessageTag>
              <PublishTime>1449556920975</MessagePublishTime>
          </Notification>
    Note

    For Short Message Service and mailbox subscription types, only the SIMPLIFIED message format is supported.