系列文章:
Window Azure(二):开发和发布一个Azure程序
Windows Azure(四-1):Worker Role(对应传统服务器BackGroud 程序)
Windows Azure(四-2):云端的文件系统(Blob Storage)
概述
Queue Storage提供给我们一个云端的队列。可以用Queue Storage来进行进程间的相互通信(包括运行在不同机器上的进程之间的通信)。
使用场景
在一个Web应用程序中,用户通过表单递交给服务器数据,服务器收到数据后将进行处理,而这一处理将花费很多时间。这种情况下,服务器端通过Queue Storage可以把用户递交的信息存储在队列中,后台再运行一个程序从队列中取得数据进行信息的处理。(说白就是队列机机制的使用场景,只不过现在是在云端的处理,同样使用RestAPI进行调用,可查看Queue 服务 API。)
Queue 服务API
Operation | Description | ||
Lists all queues under the given account. | |||
Creates a new queue under the given account. | |||
Deletes a queue. | |||
Returns queue properties, including user-defined metadata. | |||
Sets user-defined metadata on the queue. | |||
Adds a message to the queue. | |||
Retrieves a message from the queue and makes it invisible to other consumers. | |||
Retrieves a message from the front of the queue, without changing the message visibility. | |||
Deletes a specified message from the queue. | |||
|
Operation | Description |
---|---|
Lists all queues under the given account. | |
Creates a new queue under the given account. | |
Deletes a queue. | |
Returns queue properties, including user-defined metadata. | |
Sets user-defined metadata on the queue. | |
Adds a message to the queue. | |
Retrieves a message from the queue and makes it invisible to other consumers. | |
Retrieves a message from the front of the queue, without changing the message visibility. | |
Deletes a specified message from the queue. | |
Operation | Description |
---|---|
Lists all queues under the given account. | |
Creates a new queue under the given account. | |
Deletes a queue. | |
Returns queue properties, including user-defined metadata. | |
Sets user-defined metadata on the queue. | |
Adds a message to the queue. | |
Retrieves a message from the queue and makes it invisible to other consumers. | |
Retrieves a message from the front of the queue, without changing the message visibility. | |
Deletes a specified message from the queue. | |
具体使用
模拟一种情形:客户端提交数据入Queue,Server端处理
客户端(一个新建项目Console 项目,具体可见上一篇Windows Azure(四-2):云端的文件系统(Blob Storage) 的创建方式
Operation | Description |
---|---|
Lists all queues under the given account. | |
Creates a new queue under the given account. | |
Deletes a queue. | |
Returns queue properties, including user-defined metadata. | |
Sets user-defined metadata on the queue. | |
Adds a message to the queue. | |
Retrieves a message from the queue and makes it invisible to other consumers. | |
Retrieves a message from the front of the queue, without changing the message visibility. | |
Deletes a specified message from the queue. | |