AWS two SQS queues sent to one employee

I have an application that sends emails and uploads files (and resizes the image). Both of these services are not used too often and are quite lightweight.

I already use the SQS queue to send messages (via email / subject / body) to a worker working with a Sinatra application that calls the SES API, this works fine. My question is: is it possible to send file upload messages to the same employee? Perhaps this may be in another queue.

It seems pretty wasteful to have two instances of ec2 sitting there (for the most part) without doing anything.

PS: I use elastic beanstalk

+7
amazon-web-services amazon-sqs
source share
2 answers

In your post, it would be better to introduce the TYPE attribute. The TYPE message may be EMAIL / FILEUPLOAD. Based on the TYPE attribute, the worker can call the corresponding service with the message.

Using the above approach, you will be able to handle messsages with one worker and one queue. You can automatically scale the server and there will be no problems with processing messages with several employees.

+7
source share

Of course, why is not my original answer. What is inside the instance is completely up to you and under your complete control. Given that you have already indicated that using the application / server is fairly simple; You can put your other application in the same.

Just make sure the given instance size is fine if both are in the same instance; Application domain (2 applications), application configuration does not mix with each other.

PS: You will use a separate queue for a new application; if you need to send images to the queue, you can upload images to S3 and put their corresponding links in SQS messages and process them.

0
source share

All Articles