views:

287

answers:

2

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?

+1  A: 

If I were you, and if I REALLY wanted to make SQS work for this scenario, I would create a windows service that retrieves any messages from the queue every 10 minutes and then dispatches them.

If I could potentially use a different service, I would seriously consider using something like Postmark (Which I just found out about today thanks to a comment on Jeff Atwood’s blog post). You would just submit your email message info to their api, and they would do the rest. They even have a api for checking for bounced emails. I have never used this service, but I think it sounds great and would seriously consider using it in the future.

BigJoe714
A: 

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 thats the right word)

http://aws.amazon.com/sns

and for the finale of my uncertainty: not sure if it's ok to copy / paste this but, from the link above and without permission:

"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."

sherif