Scheduling Messages with RabbitMQ

110 views
Skip to first unread message

Roy Reshef

unread,
Mar 1, 2016, 4:02:11 PM3/1/16
to rabbitmq-users
Hi there,

I am experimenting at the moment with the RabbitMQ Delayed Message Plugin (https://www.rabbitmq.com/blog/2015/04/16/scheduling-messages-with-rabbitmq/).

The way to schedule a message (as described in https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/) is to set the x-delay header to the amount of milliseconds the publisher wants the message to be delayed.

This is fine, however I can think of an additional way to schedule a message - simply set up the timestamp (say as an absolute UTC timestamp to avoid date/time parsing and timezones) you want the message to be routed. The difference is not large, as the publisher can always compute the delay required between the current timestamp and the desired scheduled timestamp. It is however cleaner in the use case you do want to schedule a message for a specific timestamp, as calculating the delay requires clock synchronization (between the publisher and Rabbit MQ) and makes assumptions about the message routing within Rabbit MQ - if the publisher publishes directly to the x-delayed-message exchange it's probably OK, however if we have a topology which includes shovels and/or federations there may be some latency till the message actually gets to the x-delayed-message exchange.

Just my 2 cents (as Alvaro was asking for feedback).

Cheers,
Roy

Reply all
Reply to author
Forward
0 new messages