user2242861
user2242861

Reputation: 21

SNS and SQS Technical architecture

I am working on a blueprint to send and Receive email messages.I looking for best practice.

  1. We have to send , for example 1000 messages on click of a button. How to Use SNS and SQS to send messages right away? Is it a good idea to create one SNS request to create 1000 message in a queue?

Is there any way to schedule 1000 messages ?

  1. We receive messages, whats the best way to use SNS and SQS to process the messages?

Upvotes: 0

Views: 475

Answers (2)

E.J. Brennan
E.J. Brennan

Reputation: 46879

Don't think of it as sending 1000 emails with the click of a button, thinking of it as scheduling an email job.

Don't know all that you are trying to do, but you probably also don't want to do a 1000 message load while the user is waiting for a response after a button click.

I would consider, have 2 SQS queues (at least), the first queue is used to schedule the batch job, on a mouse click you insert a single job, i.e. 'send this email to 1000 people' as Travis R suggested.

Another job could poll Q1, see the 'send these 1000 people this email, and it could then create 1000 SQS messages into Q2, one per email address.

A third process (perhaps multiple of them), would watch Q2 and send a single email from the list, and delete the message. Using this method you could throttle you send rate down quite a bit to adapt to your ISP's restrictions, either with the SQS settings, or by limiting how often you 'email a single email' job is schedule to run.

Also consider using amazons SES and setting up another process to monitor bounces and complaints - which you are bound to have if you are kicking off 1000+ emails at a time.

Upvotes: 1

Travis Reeder
Travis Reeder

Reputation: 41133

It would probably be best to put 1 message on a queue on the button click so the user doesn't have to wait. Then have a different process that take messages off the queue and sends the emails or queues up another 1000 messages, one for each email.

Upvotes: 1

Related Questions