gpt4 book ai didi

rabbitmq - RabbitMQ客户端是否必须请求心跳超时,或者服务器默认为60?

转载 作者:行者123 更新时间:2023-12-02 20:27:01 25 4
gpt4 key购买 nike

根据 RabbitMQ 文档:

The heartbeat timeout value defines after what period of time the peer TCP connection should be considered unreachable (down) by RabbitMQ and client libraries. This value is negotiated between the client and RabbitMQ server at the time of connection. The client must be configured to request heartbeats. In RabbitMQ versions 3.0 and higher, the broker will attempt to negotiate heartbeats by default (although the client can still veto them). The timeout is in seconds, and default value is 60 (580 prior to release 3.5.5).

( https://www.rabbitmq.com/heartbeats.html )

我在解码“客户端必须配置为请求心跳”这句话时遇到问题。

这是否意味着如果客户端不请求心跳,则不会发送心跳消息?如果是这样,服务器默认值有什么意义?

我查看了 Java 和 C# 客户端,它们的客户端默认值为 60 秒。是否有客户端不默认此设置?

最佳答案

摘自文档:

Note that in case RabbitMQ server has a non-zero heartbeat timeout configured (which is the default in versions starting with 3.6.x), the client can only lower the value but not increase it.

无论如何,服务器指定默认值都没有什么坏处。协商心跳时,服务器向客户端发送其首选项,并且客户端可以配置为考虑服务器默认值。

https://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune

https://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune-ok

关于rabbitmq - RabbitMQ客户端是否必须请求心跳超时,或者服务器默认为60?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49658454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com