This topic describes the definition of a subscription, its relationship with other components, and its internal attributes in Simple Message Queue (formerly MNS).
Definition and relationship with other components
In Simple Message Queue (formerly MNS), a subscription is a rule based on which consumers register for a specific topic to receive messages. You can associate one or more subscriptions with a specific topic and customize the push rule and receiver for each subscription.
The following figure shows the relationship of a subscription with other components in a messaging model of Simple Message Queue (formerly MNS).
Feature description
Multiple subscription types: One topic can have multiple subscriptions, which correspond to different types of receivers.
Repeated message subscription: Each subscription can subscribe to all messages of a specific topic.
Subscription attributes
Subscription name
Definition: the name of a subscription, which uniquely identifies the subscription. A subscriber cannot create multiple subscriptions with the same name for the same topic.
Value: The name can be up to 255 characters in length and can contain letters, digits, and hyphens (-). It must start with a letter.
Subscription type
Definition: the type of an endpoint that subscribes to messages.
Value: The options are Queue, HTTP Server, Short Message Service, Mobile Push, and Direct Mail. For more information, see Push messages.
Receiver endpoint (Endpoint)
Message filtering tag
Definition: the tag used to filter messages. For more information about message filtering tags, see Message filtering.
Value: The tag can be up to 16 characters in length. Only one tag can be specified.
Retry policy (NotifyStrategy)
Definition: the policy that defines how SMQ retries message pushing in case of errors when SMQ pushes messages to a receiver. If a message fails to be pushed, Simple Message Queue (formerly MNS) retries to push the message based on the retry policy. After the maximum retries are reached, Simple Message Queue (formerly MNS) discards the message and continues to push the next message.
Value:
BACKOFF_RETRY: indicates three retries with a random delay between 10 seconds and 20 seconds for each retry.
EXPONENTIAL_DECAY_RETRY: indicates 176 retries with exponentially increasing delays, capped at 512 seconds. The total retry duration is one day. The specific retry intervals are 1 second, 2 seconds, 4 seconds, 8 seconds, 16 seconds, 32 seconds, 64 seconds, 128 seconds, 256 seconds, and then 512 seconds for the remaining 167 retries.
Message format (NotifyContentFormat)