RabbitMQ:x-message-ttl的默认值是多少 [英] RabbitMQ: What is the default x-message-ttl value

查看:1502
本文介绍了RabbitMQ:x-message-ttl的默认值是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在RabbitMQ文档中找不到默认的x-message-ttl值随安装一起提供.

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.

推荐答案

默认情况下,从代理方开始没有设置x-message-ttl参数,因此基本上您可以将默认值解释为无穷大.

There are no x-message-ttl argument set by default from the broker side, so basically you can interpret default value as infinity.

如果将不带ttl的消息发布到不带ttl设置的队列中(yupp,有按消息和按队列的ttl参数,请参见下面的注释):

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注意:

当按消息和按队列ttl设置的代理都使用最小值时.例如,如果每个消息的ttl是10000(10秒),每个队列的ttl是20000(20秒),则将应用每个消息的ttl.

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.

每条消息TTL注释:

ttl过期的消息将一直保留在队列中,只要它们没有到达队列头.不用担心,它们不会发送给消费者,但是会占用一些资源,直到达到极限为止. RabbitMQ队列就是这样工作的(它们坚持FIFO的想法,有时可能会破坏与AMQP协议的严格兼容性).有关更多信息,请参见实时扩展"中的注意事项.

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.

这篇关于RabbitMQ:x-message-ttl的默认值是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆