Search code examples
jmsjboss7.xhornetq

HornetQ client-failure-check-period


Suppose that after 30s (default client-failure-check-period) the client did not receive any packets from the server as a result of net connection problems.

Will the client now be disconnect from session/connection?

Suppose now I add this configration :

<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>

What will happen now?

Will the client still get disconnected from session/connection but only after trying to reconnect 1000 times (until net is available again)? Or will it ignore the need to do disconnect?


Solution

  • Regarding your first question, and according to HornetQ documentation, that can be found under 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.

    Therefore the client will assume that the connection was in fact lost and start its failure processes.

    For your second question, also according to the HornetQ documentation, that can be found under 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.

    So, yes, the connection will be dropped after 1000 attempts.