Discussion:
[rabbitmq-discuss] Hi, question about Scheduled Message Delivery
Tanya Skuridina
2012-11-28 06:28:18 UTC
Permalink
Hi,

I have an interesting question about delayed message consuming - Is it
possible to publish a message to be consumed at a later date (set
somewehere in params)?

Anybody else encountered this problem?

I found this link
http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/

but, It will be perfect, if somebody knows a decision using PHP libraries

Kind regards,

Tanya Skuridina
Michael Klishin
2012-11-28 07:21:23 UTC
Permalink
2012/11/28 Tanya Skuridina <tantigrenok at gmail.com>
Post by Tanya Skuridina
I have an interesting question about delayed message consuming - Is it
possible to publish a message to be consumed at a later date (set
somewehere in params)?
Anybody else encountered this problem?
I found this link http://blog.james-carr.org/**
2012/03/30/rabbitmq-sending-a-**message-to-be-consumed-later/<http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/>
Tanya,

RabbitMQ does not support scheduled message delivery.
--
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121128/c2d1a33f/attachment.htm>
Matthias Radestock
2012-11-28 07:54:35 UTC
Permalink
Post by Michael Klishin
2012/11/28 Tanya Skuridina <tantigrenok at gmail.com
<mailto:tantigrenok at gmail.com>>
I have an interesting question about delayed message consuming - Is
it possible to publish a message to be consumed at a later date (set
somewehere in params)?
Anybody else encountered this problem?
I found this link
http://blog.james-carr.org/__2012/03/30/rabbitmq-sending-a-__message-to-be-consumed-later/
<http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/>
Tanya,
RabbitMQ does not support scheduled message delivery.
Well, it does, with the trick above, i.e. using a combination of message
expiry (per-queue message ttl prior to 3.0, and that or per-message ttl
in 3.0, though note the caveats
http://www.rabbitmq.com/ttl.html#per-message-ttl-caveats) and dead
lettering.

Regards,

Matthias.
Randall Richard
2012-11-29 13:23:19 UTC
Permalink
Regarding the caveats and triggering expiry only on a message at the head
of the queue, are there plans to support message expiration independent of
position in queue?

Just to clarify on the current 3.0 implementation, if I understand this
correctly, this means that if I have two unconsumed messages (e.g. the
queue's consumer has disappeared for several minutes) where the first
message has no TTL and the second has a 5 second TTL, this 5 second TTL
message will not be dead lettered until the non-TTL message is consumed?

Thanks,

-Randall

On Wed, Nov 28, 2012 at 2:54 AM, Matthias Radestock
Post by Matthias Radestock
Post by Michael Klishin
2012/11/28 Tanya Skuridina <tantigrenok at gmail.com
<mailto:tantigrenok at gmail.com>**>
I have an interesting question about delayed message consuming - Is
it possible to publish a message to be consumed at a later date (set
somewehere in params)?
Anybody else encountered this problem?
I found this link
http://blog.james-carr.org/__**2012/03/30/rabbitmq-sending-a-**
__message-to-be-consumed-**later/<http://blog.james-carr.org/__2012/03/30/rabbitmq-sending-a-__message-to-be-consumed-later/>
<http://blog.james-carr.org/**2012/03/30/rabbitmq-sending-a-**
message-to-be-consumed-later/<http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/>
Tanya,
RabbitMQ does not support scheduled message delivery.
Well, it does, with the trick above, i.e. using a combination of message
expiry (per-queue message ttl prior to 3.0, and that or per-message ttl in
3.0, though note the caveats http://www.rabbitmq.com/ttl.**
html#per-message-ttl-caveats<http://www.rabbitmq.com/ttl.html#per-message-ttl-caveats>)
and dead lettering.
Regards,
Matthias.
______________________________**_________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.**rabbitmq.com<rabbitmq-discuss at lists.rabbitmq.com>
https://lists.rabbitmq.com/**cgi-bin/mailman/listinfo/**rabbitmq-discuss<https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121129/ed938eed/attachment.htm>
Matthias Radestock
2012-11-30 14:42:09 UTC
Permalink
Randall,
Post by Randall Richard
Regarding the caveats and triggering expiry only on a message at the
head of the queue, are there plans to support message expiration
independent of position in queue?
No concrete plans, though we do of course recognise that this is a
feature some users may want.
Post by Randall Richard
Just to clarify on the current 3.0 implementation, if I understand this
correctly, this means that if I have two unconsumed messages (e.g. the
queue's consumer has disappeared for several minutes) where the first
message has no TTL and the second has a 5 second TTL, this 5 second TTL
message will not be dead lettered until the non-TTL message is consumed?
Correct.

So to use the existing TTL facilities for scheduled message delivery you
need to be able to place the messages in queues s.t. their expiries are
monotonically increasing.

Depending on the range and granularity at which you want scheduled
delivery to take place, you may be able to construct a chained set of
queues and dead letter exchanges to get messages delivered at the
desired schedule.

E.g. if your scheduling range was 10 hours at a granularity of 5 minutes
you could have an "hours" exchange, with a "0h", "1h", "2h", ... "9h"
queues that all dead-letter to a "minutes" exchange with "0m", "5m", ...
"55m" queues that all dead-letter to a final exchange which then routes
messages to their ultimate destinations.

It's a bit fiddly, but you only have to set this up once and then never
touch it again. And for the sender things are simple - they just send
messages with a routing key of "5h.10m" (the "hours" exchange would
route on the first part, the "minutes" exchange on the second part).


Regards,

Matthias.

Tanya Skuridina
2012-11-28 08:58:56 UTC
Permalink
Already solved by myself, thanks)
Post by Tanya Skuridina
Hi,
I have an interesting question about delayed message consuming - Is it
possible to publish a message to be consumed at a later date (set
somewehere in params)?
Anybody else encountered this problem?
I found this link
http://blog.james-carr.org/2012/03/30/rabbitmq-sending-a-message-to-be-consumed-later/
but, It will be perfect, if somebody knows a decision using PHP libraries
Kind regards,
Tanya Skuridina
Continue reading on narkive:
Loading...