Question

I've got an Email Azure Worker Role which (you guessed it), simply sends an email.

It works off a queue which has the To, From, and Body. So the actual queue message has the email itself.

But i've run into an issue where the size of an email exceeded 64KB, so it cannot be put on the queue.

So now i'm thinking i need to store the email on an Azure Blob, then store a reference to that blob on the message instead. Then the worker can just grab the email from the blob.

But it seems like Blob Storage is more for images, files, etc - this is simply a POCO in memory i have created.

How can i essentially put a POCO on an Azure Blob - or does anyone have any other ideas to accomplish this task?

Was it helpful?

Solution

Solved my problem.

  1. Serialize objects to a string. (using JSON.NET)
  2. Create MemoryStream from string bytes, pop on Azure Blob
  3. Create a queue message with a reference to the Blob GUID
  4. Worker Role picks up message, grabs stream from Blob, converts back into C# POCO, sends emails.

OTHER TIPS

You can serialize your object in order to store it in a Windows Azure queue. This post shows how to do so. Passing object messages in Azure Queue Storage

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top