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

Azure 队列存储是一个可存储大量消息的服务。Azure Queue storage is a service for storing large numbers of messages. 可以使用 HTTP 或 HTTPS 通过经验证的调用从世界任何位置访问消息。You access messages from anywhere in the world via authenticated calls using HTTP or HTTPS. 队列消息大小最大可为 64 KB。A queue message can be up to 64 KB in size. 一个队列可以包含数百万条消息,直至达到存储帐户的总容量限值。A queue may 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:

    https://<storage account>.queue.core.chinacloudapi.cn/<queue>

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

    https://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. 队列名称必须全部小写。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. 在 2017-07-29 以前的版本中,允许的最大生存时间为 7 天。Before version 2017-07-29, the maximum time-to-live allowed is seven days. 在 2017-07-29 或更高版本中,最大生存时间可以是任何正数,或者是 -1(表示消息不会过期)。For version 2017-07-29 or later, the maximum time-to-live can be any positive number, or -1 indicating that the message doesn't expire. 如果省略此参数,则默认的生存时间为 7 天。If this parameter is omitted, the default time-to-live is seven days.

后续步骤Next steps