I have an application which sends emails and performs file uploads (and image resizing). Both of these services are not used too often and are quite light.
I'm already using a SQS queue to send messages (email to/subject/body) to a worker running a Sinatra app calling the SES API, this is running fine. My question is: is it possible to send file upload messages to that same worker too? This could be on a different queue maybe.
It seems pretty wasteful to have two ec2 instances sitting there, (for the most part), doing nothing.
PS: I'm using elastic beanstalk
It would be better to introduce a attribute TYPE in your message. Message TYPE could be EMAIL/FILEUPLOAD. Based on the attribute TYPE, the worker can call the respective service with the message.
With the above approach, you would be able to process messsages with one worker & one queue. You can auto-scale the server too and there will be no problems with processing messages with multiple workers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With