[rabbitmq-discuss] Scheduled/postponed messages

Konstantin Tjuterev kostik.lv at gmail.com
Mon Apr 25 12:02:14 BST 2011


Hi, I'm trying to implement the following scenario with RabbitMQ:

- a site which generates various emails according to user actions (like
registration, ordering etc.), or according to schedule (daily
announcements); emails are published into an RabbitMQ exchange
- a set of workers which read the queue and send out emails, do some logging
- some emails need to be sent immediately
- some should be sent precisely at specific time (or as close as possible),
like daily announcement should go out exactly at 8:00AM
- generating daily announcements involves complex logic and takes some time
(more than actual delivery), so there is a job which prepares it before time
X and publishes into an exchange

So, my question is if there is a native way to schedule messages to be
delivered to workers exactly at specific time? If there is not, which
strategy do you think would be the best:
- declaring a separate queue for such scheduled/postponed messages and
starting workers at required time (by cron)
- having a check-what-time-is-it/sleep cycle in the workers (which are
always running)
- having workers consume the message, check time and do NOT send
acknowledgement if it's not yet the time to process it (this is the only
strategy I see, NOT requiring separate workers, but it will use a lot of
resources for retrying message delivery)
- anything else?

Thanks in advance,

Konstantin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110425/3fd85e4d/attachment.htm>


More information about the rabbitmq-discuss mailing list