A queue in Simple Message Queue (SMQ, formerly MNS) is a message container where producers send messages and consumers retrieve them.
Features
At-least-once delivery
Each message is delivered to a consumer at least once within its retention period and maximum delivery attempts. Design your consumers to handle duplicates through idempotent operations -- processing the same message multiple times should not change the outcome.
Batch processing
Send, receive, and delete up to 16 messages in a single batch request, reducing the number of API calls.
Long polling
With long polling, a receive request waits up to 30 seconds for a message to arrive instead of returning an empty response immediately. This reduces request volume and lowers costs. For details, see Short polling and long polling.
Visibility timeout
After a consumer receives a message, the message becomes invisible to other consumers for a configurable duration. This prevents multiple consumers from processing the same message simultaneously. If message processing fails or the visibility timeout expires, the message returns to the Active state and may be repeatedly delivered. Set this value to match or exceed the expected processing time of your consumer.
Queue properties
| Property | Description | Valid values | Default | Unit |
|---|---|---|---|---|
| Queue name | Globally unique identifier of the queue within a cluster. Must start with a letter or digit. Can contain letters, digits, and hyphens (-). | Up to 120 characters | -- | -- |
| Maximum message size | Maximum size of the message body that can be sent to the queue. | 1--64 | [needs confirmation] | KB |
| Long polling period | Wait time for long polling. 0 disables long polling. Any non-zero value enables long polling: the system returns a response only after a valid message is received or the wait time elapses. | 0--30 | [needs confirmation] | Seconds |
| Message visibility timeout period | Duration a message stays in the Inactive state after a consumer receives it. If message processing fails or the timeout expires, the message returns to the Active state and may be repeatedly delivered. Set this value to match the expected processing time of your consumer. | 1--43,200 (1 second to 12 hours) | [needs confirmation] | Seconds |
| Message retention period | Maximum time a message is kept in the queue. After this period, the message is deleted regardless of whether it has been consumed. | 60--604,800 (1 minute to 7 days) | [needs confirmation] | Seconds |
| Message delay time | Default delay applied to all messages sent to the queue. Messages are not available for consumption until the delay period elapses. | 0--604,800 (0 seconds to 7 days) | [needs confirmation] | Seconds |
| Logging | Enables or disables log collection for the queue. When enabled, SMQ pushes operation logs to a logging bucket where message traces, delays, and other operational data are available. For details, see Log management. | true, false | [needs confirmation] | -- |
Default values are not documented in the source. Verify the defaults listed above against the SMQ console or API before publishing.
Limitations
| Resource | Limit | What happens |
|---|---|---|
| Queue name length | 120 characters | Queue creation fails. |
| Queues per region | 1,000 | Queue creation fails. To request a higher quota, go to Quota Center and increase the Maximum Queue Quantity in a Single Region quota. For instructions, see Submit an application to increase a quota. |
| Message size | 64 KB | The message is discarded. |
| Messages per batch operation | 16 | -- |
| Long polling wait time | 30 seconds | -- |
| Message retention | 7 days (604,800 seconds) | After the retention period expires, the message is deleted regardless of whether it has been consumed. Set a retention period that matches your business requirements. |