amranidev / micro-bus

Event driven microservices with laravel/lumen and AWS
MIT License
73 stars 11 forks source link

Multiple queue wokers #16

Closed kak2z7702 closed 2 years ago

kak2z7702 commented 2 years ago

Hi. I can have more than 500 messages in sqs in one minute. I want to set up for my subscriber multiple workers to process for one sqs. How can I do this? There is not a word about this in the documentation) Thank you.

amranidev commented 2 years ago

Hey @kak2z7702 - There is a solution for that. if you're expecting to have more than 500 messages in the queue at once then you will have to consider to configure the supervisor in your servers. you can specify how much replicated processes you want. numprocs=10

in your supervisor configuration file.

[program:application]
process_name=%(program_name)s_%(process_num)02d
command=php /your-laravel-application-path/artisan queue:work subscriber --tries=6
autostart=true
autorestart=true
numprocs=10
kak2z7702 commented 2 years ago

thank you so much.