I am implementing rabbitMQ with more than 3 workers processing. To test it, I need to execute worker file each time, but I don't want that.
I want my worker script to listen all request continuously without manually executing worker file. Many people suggested CRON but I don't want because if previous run hasn't finished then overlap can cause serious issues.
Is there any way to run my worker script continuously in background?
What you actually want is to run your worker as a daemon. The basic idea is to run your task in a loop without any user interaction and write the output into a log file.
This is a complex task and depending on the programming language of your choice there might be a library that will handle that for you.
Another useful approach specific to RabbitMQ is to run your worker code as command line program with the RabbitMQ-cli-consumer. This approach will work for any programming language with cli support. Especially for script languages with stability issues like PHP this will be the favorable way to go.
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