All Products
Search
Document Center

Message Service:Queue-related terms

Last Updated:Sep 27, 2023

This topic describes the terms that are related to MNS queues.

  • account

    • The ID of an Alibaba Cloud account.

  • queue

    • The destination address where messages are stored. Queues are sorted into standard queues and delayed queues. A message contains message content and related parameters. Messages are sorted into standard messages and delayed messages. The Message ID and ReceiptHandle parameters can uniquely identify a message in a queue.

  • standard queue

    • lf the DelaySeconds parameter is unspecified when a message is sent to a standard queue, the message is immediately consumed after it is received.

  • delayed queue

    • If the DelaySeconds parameter is specified when a message is sent to a delayed queue, the message is not consumed until the specified delay period expires. You can call the CreateQueue and SetQueueAttributes API operations to specify the message delay period of a queue.

  • queue owner

    • After you activate MNS, you can call the CreateQueue API operation to create a queue. Your Alibaba Cloud account is the owner of the queue. Queue owners are authorized to perform all operations on the queue. You can view the account ID of a queue owner on the official website of Alibaba Cloud.

  • producer

    • The client that sends messages to an MNS queue.

  • consumer

    • The client that receives messages from an MNS queue.

  • Endpoint

    • The access endpoint of MNS is in the http://$AccountId.mns. $Region.aliyuncs.com format.

      • mns. <Region>.aliyuncs.com : Region specifies the region where MNS is deployed. You can specify a region based on your needs.

      • AccountId specifies the account ID of the queue owner. You must replace AccountId with the actual account ID when you call API operations.

  • standard message

    • The message that can be immediately consumed after it is delivered to a queue.

  • delayed message

    • The message that is sent to a queue but cannot be consumed until the specified delay period expires. You can specify the message delay period by setting the DelaySeconds parameter. For more information, see SendMessage.

  • message ID

    • A message ID is used to identify a message in a queue. Message IDs are unique to a queue, but not across queues. When a message is sent to an MNS queue, MNS generates a message ID. The message ID cannot be changed and is returned in the response. You can use the message ID to verify data. To delete a message, you must use the receipt handle.

  • receipt handle

    • A receipt handle is the temporary message identifier that is generated by MNS when a message is consumed. A receipt handle is different from a message ID. To delete a consumed message or modify the value of the VisiblityTimeout parameter, you must use a receipt handle.

      A receipt handle can be used only once. If the status of a message changes, the receipt handle expires. In this case, to delete the message or modify the value of the VisibilityTimeout parameter, you must receive the message again to retrieve a new receipt handle.

  • message status

    • A standard message has the following status changes:

      • When a standard message is sent to a standard queue, the initial status of the message is Active. After the message is consumed, the status changes to Inactive. The status remains Inactive within the period that is determined by the VisibilityTimeout parameter. After the specified period expires, the status of the message changes to Active. If the message is deleted within the specified period, the status of the message changes to Deleted.

      • When a standard message is sent to a delayed queue, the initial status of the message is Delayed. After the period that is specified by the DelaySeconds parameter expires, the status of the message changes to Active.

      A delayed message undergoes the following status changes:

      When a delayed message is sent to a queue, the initial status of the message is Delayed. After the period that is specified by the DelaySeconds parameter expires, the status of the message changes to Active.

      The maximum retention period of a message is determined by the MessageRetentionPeriod parameter. After the specified period expires, the status of the message changes to Expired and is recycled by a garbage collector.

      Only messages in the Active state can be consumed.

      The following figure shows the transition of message statuses.

      Message statuses

      The following figure shows the lifecycle of a message.

      Message lifecycle