c# - 使用 Amazon SQS 的最佳实践 - 轮询队列

标签 c# amazon-web-services amazon-sqs

我正在设计一项服务,用于为我们的电子商务网站发送电子邮件(订单确认、提醒等...) 计划是有一个“SendEmail”方法,它生成一个表示要发送的电子邮件的 XML block ,并将其粘贴到 Amazon SQS 队列中。 我的网络应用程序和其他应用程序将使用它来“发送”电子邮件。

然后我需要一种检查队列并实际发送电子邮件的方法。 (我知道我将如何发送电子邮件)

我很好奇“轮询”队列的最佳方式是什么?

我是否应该创建一个 Windows 服务,并使用类似 Quartz.net 的东西来安排它每隔 x 分钟检查一次队列? 有更好的方法吗?

最佳答案

听起来更像 Amazon SNS是你的越橘。 (不太确定那是什么意思,但我曾经在电影中看到过)。

SQS 更像是“希望有人在它过期之前的某个时候来寻找这条消息!” SNS 看起来更像是“我需要确保它能立即到达任何需要它的人手中!”

它甚至包括作为预建传输的电子邮件。 (甚至不确定这是不是正确的词)

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.

可以肯定的是,它们与其他服务具有相同的免费增值模式,但对电子邮件有限制:

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.

关于c# - 使用 Amazon SQS 的最佳实践 - 轮询队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2679024/

相关文章:

c# - 根据 QnAMaker 中的输入对结果进行排名

c# - 'await' 运算符只能在 Xamarin Android 中的异步方法中使用

c# - 如何在多个环境中测试应用程序? - 共享点

c# - 如何为自定义类创建自定义扩展方法?

json - 如何在 AWS 中使用 CloudFormation 模板包含 'mysql_secure_installation'

java - AWS 源代码错误?

amazon-web-services - 如何通过 Ansible 向 AWS 安全组添加标签?

amazon-web-services - 如何将连接器添加到 Amazon EMR 上的 presto

amazon-web-services - 多个 SQS 队列与 1 个 SNS 主题

amazon-web-services - Amazon SQS 死信队列 : Is it really dead letter or poison?