All Products
Search
Document Center

Message Service:Queue

Last Updated:Dec 25, 2023

A queue is a destination where messages are stored. Queues are categorized into standard queues and delayed queues. If you do not configure the DelaySeconds parameter for messages sent to a standard queue, the messages can be immediately consumed. If you do not configure the DelaySeconds parameter for messages sent to a delayed queue, the messages cannot be consumed until the specified delay period ends.

  • QueueURL

    • Format: http://$AccountId.mns.<Region>.aliyuncs.com/queues/$QueueName.

    • mns.<Region>.aliyuncs.com: the endpoint of MNS. Region specifies the region where MNS is activated. Replace <Region> with the ID of the region where the queue resides.

    • AccountId: the account ID of the queue owner.

    • QueueName: the name of the queue. In the same region, each queue name within an Alibaba Cloud account must be unique.

Parameters

  • DelaySeconds

    • The period for which messages are delayed. Unit: seconds.

    • Valid values: 0 to 604800.

    • If you set this parameter to a value that is greater than 0, all messages that are sent to the queue are delayed and cannot be consumed until the specified period ends.

    • If you configure the DelaySeconds parameter for messages sent to a queue, the system uses the delay period that is specified in the request instead of the delay period that is specified for the queue.

  • MaximumMessageSize

    • The maximum size of a message body. Unit: bytes.

    • Valid values: 1024 to 65536.

    • If the size of the message body exceeds the limit, the message fails to be published to the topic.

  • MessageRetentionPeriod

    • The maximum period for which a message can be retained in the queue. Unit: seconds.

    • Valid values: 60 to 604800.

    • A message that is sent to the queue can be retained for a specified period. After the specified period ends, the message is deleted no matter whether it is consumed.

  • VisibilityTimeout

    • The period for which a message remains the Inactive state after it is received. Unit: seconds.

    • Valid values: 1 to 43200.

    • After a message is received, the message remains in the Inactive state within a specified period. During this period, the message cannot be received by other consumers, but you can delete the message or modify the value of the VisibilityTimeout parameter. After the specified period ends, the message can be received again.

  • PollingWaitSeconds

    The maximum timeout period when you call the ReceiveMessage or BatchReceiveMessage operation. Unit: seconds.

    Valid values: 0 to 30.

    If no message is available in the queue when you call the ReceiveMessage or BatchReceiveMessage operation, MNS holds the request within a specified period. If a message is sent to the queue during this period, the message is immediately received. If no message is sent to the queue during the specified period, MNS returns the MessageNotExist error message.

    If you configure the waitseconds parameter when you receive messages from a queue, the system uses the timeout period that is specified in the request instead of the timeout period that is specified for the queue.

  • LoggingEnabled

    Specifies whether to enable the log management feature for the queue. Valid values:

    Valid values: True and False.

    If you set the LoggingEnabled parameter to True, MNS pushes the operation logs of the queue to a specified Object Storage Service (OSS) bucket. For more information, see Log management.

  • CreateTime

    • The time when the queue was created. The value is a timestamp that follows the UNIX format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.

  • LastModifyTime

    • The time when the queue was last modified. The value is a timestamp that follows the UNIX format. It is the number of seconds that have elapsed since 00:00:00 Thursday, January 1, 1970.

  • ActiveMessages

    • The total number of messages that are in the Active state in the queue. The value is an approximate number.

  • InactiveMessages

    • The total number of messages that are in the Inactive state in the queue. The value is an approximate number.

  • DelayMessages

    • The total number of messages that are in the Delayed state in the queue. The value is an approximate number.