最佳实践使用Amazon SQS - 轮询队列 [英] Best practices for using Amazon SQS - Polling the queue

查看:178
本文介绍了最佳实践使用Amazon SQS - 轮询队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计一个服务向用户发送电子邮件,为电子商务网站(订单确认,报警等) 该计划是有一个SendEmail的方法,即生成XML再$ P $的一大块psenting要发送的电子邮件,并坚持它在Amazon SQS队列。 我的web应用程序(S)和其他应用程序将使用它来送的电子邮件。

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?

我应该创建一个Windows服务,并使用类似Quartz.net安排它来检查队列每隔x分钟例如多少? 是否有这样做的更好的办法?

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?

推荐答案

如果我是你,如果我真的想使SQS工作,对于这种情况,我将创建一个Windows服务,从队列检索每10任何消息分钟,然后分派他们。

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.

如果我有可能使用不同的服务,我会认真考虑使用类似邮戳(我刚发现今天多亏上的杰夫·阿特伍德的博客文章)。你只需提交您的电子邮件信息,以他们的API,他们会做休息。他们甚至有一个API,用于检查退回的电子邮件。我从来没有使用过这种服务,但我认为这听起来不错,并会认真考虑在未来使用它。

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.

这篇关于最佳实践使用Amazon SQS - 轮询队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆