HornetQ client-failure-check-period

HornetQ client-failure-check-period

假设30秒后(默认client-failure-check-period)由于网络连接问题,客户端没有收到来自服务器的任何数据包。

客户端现在会与 session/connection 断开连接吗?

假设我现在添加这个配置:

<retry-interval>1000</retry-interval>
<retry-interval-multiplier>1.5</retry-interval-multiplier>
<max-retry-interval>60000</max-retry-interval>
<reconnect-attempts>1000</reconnect-attempts>

现在会发生什么?

客户端是否仍会与 session/connection 断开连接,但只是在尝试重新连接 1000 次之后(直到网络再次可用)?还是会忽略断开连接的需要?

关于您的第一个问题,根据 HornetQ 文档,可以在 17.2. Detecting failure from the client side:

下找到

As long as the client is receiving data from the server it will consider the connection to be still alive.

If the client does not receive any packets for client-failure-check-period milliseconds then it will consider the connection failed and will either initiate failover, or call any FailureListener instances (or ExceptionListener instances if you are using JMS) depending on how it has been configured.

因此客户端会假定连接实际上已丢失并启动其失败进程。

关于你的第二个问题,同样根据 HornetQ 文档,可以在 34.3. Configuring reconnection/reattachment attributes:

下找到

reconnect-attempts. This optional parameter determines the total number of reconnect attempts to make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts. The default value is 0.

所以,是的,连接将在 1000 次尝试后断开。