How to run a task at a scheduled time using RabbitMQ

I use RabbitMQ so that each task pool starts sequentially one after another. But how to add a time parameter so that the task runs only at a certain time in the future (for example, scheduled tasks ).

+6
source share
3 answers

RabbitMQ is not a task scheduler, although the documentation speaks of "planning" a task. You can use something like cron. You can also use a library like sched to create a scheduler in a Python process.

FYI It looks like this question has already been answered: Postponed message in RabbitMQ

+5
source

You can use celery with rabbitmq as a broker for scheduling tasks. Here is the celery documentation http://docs.celeryproject.org/en/master/index.html

+1
source

RabbitMQ has a plugin for pending messages .

Using this plugin, messages can be delivered to the appropriate queue after a certain delay. Thus, using this, you can use RabbitMQ as a scheduler, although it is not a task scheduler by nature.

0
source

Source: https://habr.com/ru/post/953691/


All Articles