AzureQueue project
A data access layer (DAL) class library project that handles create, read, update, and delete (CRUD) operations on the Azure Queue.
The e-mail queue
By default a queue for processing e-mails is created by the AzureProviders solution. Whenever an e-mail is to e sent it is first placed in the e-mail queue to be processed asynchronously by the
MultiThreadedWorkerRole role. This is very useful as the process sending the e-mail does not have to wait until the e-mail is sent before continuing its further processing
AzureQueueContext.cs file
The
AzureQueueContext class is the context for the
AzureQueueDataSource class. It holds information like
- the name of the e-mail queue,
- the cloud storage account in use,
- the current cloud queue client.
Retry policy
The
AzureQueueContext class also sets the number of retries before failing; by default an e-mail is attempted sent three times before being ignored. Application setting key
QueueDequeueRetrySleepSeconds decides how many seconds the queue waits before retrying after a failed attempt.
Nagling
HTTP
PUT requests smaller than 1460 bytes are inefficient with nagling turned on. The AzureProviders solution has turned nagling off by default, this setting is set in the
UseNaglingWithQueue application setting key.
See
http://blogs.msdn.com/b/windowsazurestorage/archive/2010/06/25/nagle-s-algorithm-is-not-friendly-towards-small-requests.aspx for information about gained advantages by turning off nagling.
AzureQueueDataSource.cs file
The
AzureQueueDataSource class is the data source against the Azure Queue.
E-mail serialization
AzureQueueDataSource also handles internal operations like serializing and de-serializing to and from JSON. The e-mails that are put in the e-mail queue is stored there as
EmailEntity objects serialized as JSON.
Creating the e-mail queue
AzureQueueDataSource.CreateQueuesIfTheyDontExists() contains code that creates the e-mail queue, this is currently called from
~/Admin/InitApp.aspx. In early versions of AzureProviders this was done automatically, this was removed later since the overhead and expense was considered too much.
EmailEntity.cs file
The
EmailEntity class is used for serializing and de-serializing e-mails as the e-mails are placed and retrieved from the e-mail queue.