Search code examples
rabbitmqpika

RabbitMQ - notification if message is waiting too long in queue


Is there a way how to get notification from RabbitMQ if a message is waiting in queue for a long time?


Solution

  • A common and standard solution to ensure that a delivery latency requirement is met is to set a Time To Live (TTL) on the message, and if this expires, this will be moved to the Dead Letter Queue where you can perform compensating actions.

    TTL can be defined

    • On a per-message basis by the message publisher
    • As a default on the queue itself

    If both the queue and the message have the TTL set, then the lower latency will be policed.