Best practices for using Amazon SQS - Polling the queue

前端 未结 5 1242
北恋
北恋 2021-02-07 20:13

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

相关标签:
5条回答
  • 2021-02-07 20:31

    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.

    0 讨论(0)
  • 2021-02-07 20:38

    You can use the AWS Beanstalk service to consume the tasks in the Queue. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html

    0 讨论(0)
  • 2021-02-07 20:45

    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.

    0 讨论(0)
  • 2021-02-07 20:53

    Windows service is the best way, but you must not take it. To run background job in ASP.NET environment there is HostingEnvironment.QueueBackgroundWorkItem. A good starting point to implement continues polling (via long polling) is sqs-consumer.

    0 讨论(0)
  • 2021-02-07 20:57

    Looks like SES is what you need. http://aws.amazon.com/ses/ It is very inexpensive too compared to other similar services or building other systems.

    0 讨论(0)
提交回复
热议问题