什麼是 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.windows.net/<queue>

    下列 URL 可定址圖中的佇列:The following URL addresses a queue in the diagram:

    https://myaccount.queue.core.windows.net/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 之前,允許的存留時間上限是七天。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