[rabbitmq-discuss] TTL on Messages

Stephen Young stephen.t.young at gmail.com
Thu Sep 20 14:29:12 BST 2012


TTL is set on a queue basis, so publishing to queue *ttl_queue_1s* that has 
been initialized {x-message-ttl: 1000} the message will be dropped by 
rabbitmq after one second. Messages themselves cannot set their own TTL, as 
far as I'm aware.
The best approach I've found to tracking what gets dropped is using dead 
letter exchanges (http://www.rabbitmq.com/dlx.html) - so you'd configure 
your TTL queue with {x-dead-letter-exchange: other_exchange} and then route 
the requests through there and track on the client side what has been 
dropped.

On Thursday, September 20, 2012 3:40:34 AM UTC-4, Jordan wrote:
>
> Hey guys,
>
> I'm currently using node-amqp <https://github.com/postwait/node-amqp>, 
> and would like to set an expiration on my messages.
>
> I recently learned about the 'x-message-ttl' flag, but I'm not quite sure 
> how to properly use it.  In particular, if a message expires, do I have any 
> way of knowing *which* message it was?  Perhaps a correlation id?
>
> Thanks for the help!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120920/83193eb3/attachment.htm>


More information about the rabbitmq-discuss mailing list