I would like to have my CI server use a SQS queue to send out email. At the appropriate times, my server would put a message on this queue with all the particulars of the email to be sent out . Then, a daemon listening to this queue would notice that there is a new message, dequeue it and do the right thing and actually send out the email.
My question – I would like my server to have only 1 “send_email” queue instance and always use that. So, would I create the queue in the _construct() of my main controller? This way, will it just get created once? Am I thinking about this the right way?
Thanks!
Mmiz
Yes, that works just fine. If you attempt to create an SQS queue with the exact same attribute names and values as another queue, CreateQueue simply returns success. This allows you to go ahead and create the queue every time your server starts up, without issue.