S
S
skomoroh2014-03-13 13:58:56
Python
skomoroh, 2014-03-13 13:58:56

RabbitMQ - how to make a delay in time?

How in MQ (rabbit or radish) to make tasks on time?
For example, I need a message to arrive exactly at such and such a time, or, for example, I need to make a timeout between the input and output of the message for 10 seconds.
And yet, how to shuffle the queue or select a random message?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
Z
zarincheg, 2014-03-13
@zarincheg

It seems that queues are not really needed for your tasks. You need a task scheduler. And a random choice of the message can be done for example from a DB.

S
Sergey, 2014-03-13
Protko @Fesor

RabbitMQ: message delivery by...
but rabbitmq is not designed for that at all. Use cron or use some library to implement a daemon process with your own logic. And there, at the right time, send a message to the queue.
As for the "pull out the overhead message," I will not tell you, and I'm not even sure that it is possible.

A
afiskon, 2014-03-15
@afiskon

Well, first of all, you can write to the queue with a delay. Of course, if you write in a normal language, in which this can be done without much difficulty. But this is not cool, since the machine can die and the message will not be recorded.
You can also add to each message the time at which it should be processed. Then, in fact, the same task with a delay is shifted to the worker, who clears the queue.

C
cadmi, 2014-03-17
@cadmi

Well, look how their sheduler is written in Celery .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question