[rabbitmq-discuss] publish messages after certain period
Alexandru Scvorţov
alexandru at rabbitmq.com
Wed Feb 9 09:57:00 GMT 2011
Hi Denny,
> Basically, I'd like to be able to publish a message. I'd want that message held for 30 seconds prior to it actually being delivered. After 30 seconds the message can be delivered to the appropriate queue(s). During the 30 second window, I'd have the option of removing the message preventing it from being delivered altogether.
>
> Would RabbitMQ be able to handle this type of scenario?
It can't handle it insomuch as there's no configuration option for it.
Of course, you could build a system that does the same thing.
For instance, you could:
1) have all producers publish to a single 'incoming' queue, and have
them include the delivery time and the intended destination queue in
the message or in the message headers;
2) have a consumer consuming one message at a time (via basic.get or
with basic.consume and basic.qos) from the incoming queue and
republishing the messages to the destination queues; since this
consumer handles messages one at a time, it can wait if it receives a
message to early; this consumer would also have the option of
discarding removed messages; it could be notified of which messages to
remove by reading from another queue;
3) have normal consumers use the destination queues.
RabbitMQ doesn't do this automatically because
1) it's a messaging system, not a database; it's designed to handle
messages as quickly as possible, not store them for arbitrary lengths
of time;
2) once on a queue, a message cannot be altered or removed; i.e. you
can't remove a message from the middle of a queue.
Hope this helps.
Cheers,
Alex
On Mon, Feb 07, 2011 at 02:07:27PM -0600, Denny Swindle wrote:
> I'm pretty much a newbie at using RabbitMQ. We have a instance running on one of our servers for an application we have and so far it's been working great for what we need. But now I have a scenario and I'm wondering if it's possible to leverage RabbitMQ.
>
> Basically, I'd like to be able to publish a message. I'd want that message held for 30 seconds prior to it actually being delivered. After 30 seconds the message can be delivered to the appropriate queue(s). During the 30 second window, I'd have the option of removing the message preventing it from being delivered altogether.
>
> Would RabbitMQ be able to handle this type of scenario?
>
> Thanks -
> Denny
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list