Print this page

MQ provides two parameters to enable it to detect if the remote end of a channel is no longer there:

  • Heartbeat Interval
  • KeepAlive Interval

In both cases, if one side of a channel doesn't get a response within a scpecific interval, MQ sets the channel status to Inactive, so it can be restarted when messages arrive.  This prevents a receiver channel being stuck in a RUNNING state after a network problem, waiting for a previous socket signature.

KeepAlive, a TCP/IP function was introduced before the Heartbeat interval.  As the Heartbeat Interval is controlled by MQ and can be configured for each channel (rather than at a server level, apart from z/os), this value is usually used.

Prior to MQ version 7 the KeepAlive Interval was more relevant as the only time that heart beats were generated by a client was when the client application issues a GET with a WAIT.  Also, KeepAlive could be argued to be more robust as it checks for a live socket on the remote end, rather than waiting for a heart beat from a process which may be temporaily hanging.

The MQ Intercommunication manual recommends that you "give the KeepAliveInterval a higher value than the heartbeat interval, and a smaller value than the disconnect value", giving precedence to the Heartbeat interval.

This should be combined with ADOPTMCA, which allows the sender to instruct the other side to give up waiting on an old instance.