根据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秒 . 是否有客户没有默认这个?
1 回答
从文件:
在任何情况下,服务器指定默认值都没有坏处 . 在协商心跳时,服务器向客户端发送其首选项,并且可以将客户端配置为考虑服务器默认值 .
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