I couldn't find in RabbitMQ documentation the default x-message-ttl value comes with the installation.
I know how to set it to a desired value but I am curious to know the default value.
RabbitMQ allows you to set TTL (time to live) for both messages and queues. This is controlled by optional queue arguments and best done using a policy. Message TTL can be applied to a single queue, a group of queues or applied on the message-by-message basis. TTL settings also can be enforced by operator policies.
The RabbitMQ message broker was deployed atop Google Compute Engine where it demonstrated the ability to receive and deliver more than one million messages per second (a sustained combined ingress/egress of over two million messages per second).
While the theoretical message size limit in RabbitMQ is 2GB up to 3.7. 0, we don't recommend sending messages larger than 128MB, which is also the new max size limit in 3.8. 0 and onward. Large messages are especially problematic when using mirrored queues in HA clusters and can cause memory and performance issues.
By default, queues keep an in-memory cache of messages that is filled up as messages are published into RabbitMQ. The idea of this cache is to be able to deliver messages to consumers as fast as possible. Note that persistent messages can be written to disk as they enter the broker and kept in RAM at the same time.
There are no x-message-ttl
argument set by default from the broker side, so basically you can interpret default value as infinity.
If you publish message without ttl to queue without ttl set (yupp, there are per-message and per-queue ttl arguments, see note below):
if message published as persistent and queue declared as persistent message will stay in queue as long as it will not be consumed;
if message was not published as persistent or queue was not declared as persistent, then message will stay in queue as long as it will not be consumed or until broker restart.
TTL note:
When both per-message and per-queue ttl set broker use the minimal vale. For example, if per-message ttl is 10000 (10 sec) and per-queue ttl is 20000 (20 sec) then per-message ttl will applied.
Per-message TTL note:
Messages with expired ttl will stay in queue as long as they not reached queue head. Don't worry, they will not be send to consumer, but they will take some resources until they reach head. This is how RabbitMQ queues works (they stick to FIFO idea, which is sometimes may break strict compatibility with AMQP protocol). See Caveats section in Time-To-Live Extensions for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With