什么是 Azure 队列?What are Azure Queues?

Azure 队列存储是一项可存储大量消息的服务,用户可以通过经验证的呼叫,使用 HTTP 或 HTTPS 从世界任何地方访问这些消息。Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere in the world via authenticated calls using HTTP or HTTPS. 一条队列消息的大小最多可为 64 KB,一个队列中可以包含数百万条消息,直至达到存储帐户的总容量限值。A single queue message can be up to 64 KB in size, and a queue can contain millions of messages, up to the total capacity limit of a storage account.

常见用途Common uses

队列存储的常见用途包括:Common uses of Queue storage include:

  • 创建积压工作以进行异步处理Creating a backlog of work to process asynchronously
  • 将消息从 Azure Web 角色传递到 Azure 辅助角色Passing messages from an Azure web role to an Azure worker role

队列服务概念Queue service concepts

队列服务包含以下组件:The Queue service contains the following components:

队列概念

  • URL 格式: 可使用以下 URL 格式对队列进行寻址:URL format: Queues are addressable using the following URL format:
    http://<storage account>.queue.core.chinacloudapi.cn/<queue>http://<storage account>.queue.core.chinacloudapi.cn/<queue>

    可使用以下 URL 访问示意图中的某个队列:The following URL addresses a queue in the diagram:

    http://myaccount.queue.core.chinacloudapi.cn/images-to-download

  • 存储帐户: 对 Azure 存储进行的所有访问都要通过存储帐户完成。Storage account: All access to Azure Storage is done through a storage account. 有关存储帐户容量的详细信息,请参阅 Azure 存储可伸缩性和性能目标See Azure Storage Scalability and Performance Targets for details about storage account capacity.

  • 队列: 一个队列包含一组消息。Queue: A queue contains a set of messages. 所有消息必须位于相应的队列中。All messages must be in a queue. 请注意,队列名称必须全部小写。Note that the queue name must be all lowercase. 有关命名队列的详细信息,请参阅 命名队列和元数据For information on naming queues, see Naming Queues and Metadata.

  • 消息: 一条消息(不管采用何种格式)的最大大小为 64 KB。Message: A message, in any format, of up to 64 KB. 消息可以保留在队列中的最长时间为 7 天。The maximum time that a message can remain in the queue is seven days.

后续步骤Next steps