[rabbitmq-discuss] Messages Timeout in Queue

Emile Joubert emile at rabbitmq.com
Mon Jul 30 13:27:50 BST 2012


Hi,

On 30/07/12 12:42, Vadiraj Hebbar wrote:
> Is it possible to set message time out in Java client API, so that
> messages drop out from queue after some interval of time if nobody
> consumes it  Except time to live(TTL)?.

What do you mean "except ttl"? Per-queue message TTL sounds related to
what you are looking for. See

http://www.rabbitmq.com/extensions.html#queue-ttl

> How to put a time -stamp on the messages in Java client publisher?

The broker will not expire messages based on any individual message
properties. The per-queue message TTL feature demands that all messages
in a queue use the same timeout, therefore it is a queue configuration
option rather than by message.

If you want to implement your own timeout scheme in the consumer then
your publishers will need to provide timestamps. This can be included
somewhere in the payload, headers or the timestamp property. Note that
interpretation of this information will be by convention decided between
consumers and producers - the broker will treat this data as opaque. You
can then instruct consumers to ignore messages that are too old based on
the timestamp provided by the producer.


-Emile






More information about the rabbitmq-discuss mailing list