Answer the question
In order to leave comments, you need to log in
How to send a termination signal to all workers in RabbitMq?
I have a big finished queue in the database of tasks.
Once a minute, the worker manager reads a batch of tasks from the database and sends them to the rmq queue (if it has less than a certain number of elements).
300 worker processes are connected to this queue, which take 1 task each and execute them until the queue is empty.
i.imgur.com/dALfdDs.png
It was necessary
to add the ability to safely and quickly stop all workers, it is quite logical to send them a message to stop through the same rmq. But it is not clear how to implement this, because the workers will continue to do tasks from the general queue and the stop message will have to wait until the queue is empty.
Perhaps I assembled this case incorrectly?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question