Reputation: 21
I am working on a blueprint to send and Receive email messages.I looking for best practice.
Is there any way to schedule 1000 messages ?
Upvotes: 0
Views: 475
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
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