C# – Best practices for using Amazon SQS – Polling the queue

amazon-sqsamazon-web-servicesc

I'm designing a service for sending out emails for our eCommerce site (order confirmations, alerts etc…)
The plan is to have a "SendEmail" method, that generates a chunk of XML representing the email to be sent, and sticks it on an Amazon SQS queue.
My web app(s) and other applications will use this to "send" emails.

I then require a way of checking the queue, and physically sending out the email messages.
(I know how I'm going to be dispatching emails)

I'm curious as to what the best way to "poll" the queue would be?

Should I create a windows service, and use something like Quartz.net to schedule it to check the queue every x number of minutes for example?
Is there a better way of doing this?

Best Answer

Sounds more like Amazon SNS is your huckleberry. (not really sure what that means, but I saw it in a movie once).

SQS is more of a "hopefully someone comes looking for this message at some point before it expires!" where SNS seems more like a "I need to make sure this gets to whoever needs it right away!"

It even includes email as a pre-built transport. (not even sure if that's the right word)

Amazon SNS provides a simple web services interface that can be used to create topics you want to notify applications (or people) about, subscribe clients to these topics, publish messages, and have these messages delivered over clients’ protocol of choice (i.e. HTTP, email, etc.). Amazon SNS delivers notifications to clients using a “push” mechanism that eliminates the need to periodically check or “poll” for new information and updates.

To be sure, they have the same freemium model as the rest of the services with limitations on email:

You can get started with Amazon SNS for free. Each month, Amazon SNS customers pay no charges for the first 100,000 Amazon SNS Requests, no charges for the first 100,000 Notifications over HTTP and no charges for the first 1,000 Notifications over Email.