All Products
Search
Document Center

Simple Message Queue (formerly MNS):Queue-related terms

Last Updated:Mar 11, 2026

Simple Message Queue (formerly MNS) uses the following terms for queue-based messaging. Familiarize yourself with these terms before you configure queues, send and receive messages, or manage the message lifecycle through the API.

Account

An Alibaba Cloud account ID. The account that creates a queue becomes its owner.

Queue

A destination that stores messages until consumers retrieve them. Producers send messages to a queue, and consumers receive messages from it. Each message in a queue is uniquely identified by a combination of its message ID and receipt handle (ReceiptHandle).

Queue types

PropertyStandard queueDelayed queue
BehaviorMessages are available for consumption immediatelyMessages remain hidden for a configurable delay period before becoming available
Delay configurationDelaySeconds is not set or is set to 0DelaySeconds is set through CreateQueue or SetQueueAttributes
When to useReal-time processing where messages should be consumed immediatelyDeferred processing where a cooldown period is needed before consumption

Queue owner

The Alibaba Cloud account that creates a queue owns it. Queue owners are authorized to perform all operations on the queue. After you activate Simple Message Queue (formerly MNS), call the CreateQueue API operation to create a queue. Find the account ID of a queue owner on the Alibaba Cloud website.

Producer and consumer

  • Producer: A client that sends messages to a queue.

  • Consumer: A client that receives messages from a queue.

Endpoint

The access URL for Simple Message Queue (formerly MNS) API calls. The format is:

http://<AccountId>.mns.<Region>.aliyuncs.com
PlaceholderDescription
<AccountId>Your Alibaba Cloud account ID. Replace with your actual account ID when calling API operations.
<Region>The region where Simple Message Queue (formerly MNS) is deployed, such as cn-hangzhou or cn-shanghai.

Message types

PropertyStandard messageDelayed message
BehaviorAvailable for consumption immediately after deliveryHidden for a specified delay period before becoming available
ConfigurationDefault behavior when no per-message DelaySeconds is setSet DelaySeconds in the SendMessage request

A delayed message uses a per-message delay set at send time. A delayed queue applies a queue-level delay to all incoming messages. Both use DelaySeconds, but at different scopes.

Message ID vs. receipt handle

PropertyMessage IDReceipt handle
Generated whenA message is sent to a queueA message is consumed from a queue
UniquenessUnique within a queue, not across queuesUnique per consume operation
LifetimePermanent and immutableTemporary; expires when the message status changes
Primary useTrack and verify dataDelete a consumed message or modify its VisibilityTimeout
ReusabilityValid for the lifetime of the messageSingle-use; consume the message again to get a new handle

To delete a message, use its receipt handle, not its message ID.

Message status

Each message transitions through the following statuses:

StatusDescription
ActiveAvailable for consumption. Only messages in this status can be consumed.
InactiveConsumed and temporarily hidden for the VisibilityTimeout duration.
DelayedWaiting for the DelaySeconds period to expire before becoming Active.
DeletedExplicitly deleted by a consumer using its receipt handle.
ExpiredExceeded the MessageRetentionPeriod and recycled automatically.

Status transitions

Standard message in a standard queue

  1. The message arrives in the queue with status Active.

  2. A consumer receives the message. The status changes to Inactive for the duration of the VisibilityTimeout period.

  3. Two outcomes are possible:

    • The consumer deletes the message within the VisibilityTimeout period. The status changes to Deleted.

    • The VisibilityTimeout period expires without deletion. The status returns to Active, and the message becomes available for consumption again.

Standard message in a delayed queue

  1. The message arrives in the queue with status Delayed.

  2. After the DelaySeconds period expires, the status changes to Active.

  3. From this point, the message follows the same transitions as a standard message in a standard queue.

Delayed message (per-message delay)

  1. The message is sent with a per-message DelaySeconds value. The initial status is Delayed.

  2. After the DelaySeconds period expires, the status changes to Active.

  3. From this point, the message follows the same transitions as a standard message in a standard queue.

Message expiration

If a message is not deleted before its MessageRetentionPeriod expires, the status changes to Expired regardless of its current status. Expired messages are automatically recycled.

Status transition diagram

Message status transitions

Message lifecycle diagram

Message lifecycle