A
A
Alexey Solodky2015-09-28 15:50:32
PHP
Alexey Solodky, 2015-09-28 15:50:32

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

1 answer(s)
V
Vladimir, 2015-09-28
@rostel

usually the workers sit under the supervisor. extinguish in it.
mnu runit watches them, I nail
all the symbolic links in /etc/service/ and everything is dead,
I need to run it, put down the links with the script again

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question