In the previous post I described how MessageId and PopReceipt can be used and provided simple examples. In this post I will continue to work with Azure Storage Queue Service. I am going to describe an important parameter QueueRequestOptions.
Refer to previous posts to get started with Azure Storage Queue Service.
QueueRequestOptions is a very important class that are used as parameter of some CloudStorageQueue methods that interact with Azure Storage Service.
QueueRequestOptions represents a set of timeout and retry policy options that may be specified for a request against Azure Queue Service. Also it specifies encryption settings. Some properties of this class are self-explanatory such as ServerTimeout, others are not.
RetryPolicy allows you execute some operations repeatedly (i.e. retry those operations) if an error has occurred while executing those operations and certain conditions are met. They also allow you to define how many times the operation should be retried and how much time should your code wait between retries.
RetryPolicy can be one of the following:
Refer to Storage Client Library 2.0 – Implementing Retry Policies for more info.
The next parameter is MaximumExecutionTime. As name suggests it sets the maximum execution time across all potential retries of a request.
A very interesting parameter is LocationMode, it allows to specify where request should go, it can be:
Azure Storage Queue Service supports encrypting data within client applications before uploading to Azure Storage, and decrypting data while downloading to the client. The library also supports integration with Azure Key Vault for storage account key management. EncryptionPolicy and RequireEncryption properties can be used to control encryption. Encryption is a very complex topic, I will make a post about Azure Key Vault and an encryption someday.
Azure Storage Queue library is very simplistic, but yet flexible. Developers can specify different request options to control the behavior. In this post I have described the QueueRequestOptions class and its parameters. I highlighted basic usage scenarios but didn't provide any code. I have done this because it depends on the use case.