Reason codes indicating that a queue manager is no longer available

What reason codes indicate that a queue manager is no longer available, or cannot be reached, when attempting automatic IBM MQ classes for JMS reconnection.

Automatic JMS client reconnection gives an overview of JMSExceptions and how the applications can restart automatically, and the information in Use automatic JMS client reconnection details the requirements for automatic client reconnection.

The following information lists the IBM MQ reason codes that the application should check for:

    RC2009
    MQRC_CONNECTION_BROKEN

    RC2059
    MQRC_Q_MGR_NOT_AVAILABLE

    RC2161
    MQRC_Q_MGR_QUIESCING

    RC2162
    MQRC_Q_MGR_STOPPING

    RC2202
    MQRC_CONNECTION_QUIESCING

    RC2203
    MQRC_CONNECTION_STOPPING

    RC2223
    MQRC_Q_MGR_NOT_ACTIVE

    RC2279
    MQRC_CHANNEL_STOPPED_BY_USER

    RC2537
    MQRC_CHANNEL_NOT_AVAILABLE

    RC2538
    MQRC_HOST_NOT_AVAILABLE

Most JMSExceptions that are thrown back to enterprise applications contain a linked MQException which holds the reason code. To implement the retry logic for the reason codes in the previous list, your enterprise applications should check this linked exception using code similar to the following example:

} catch (JMSException ex) {
        Exception linkedEx = ex.getLinkedException();
        if (ex.getLinkedException() != null) {
            if (linkedEx instanceof MQException) {
                MQException mqException = (MQException) linkedEx;
                int reasonCode = mqException.reasonCode;
                // Handle the reason code accordingly
            }
        }
    }
Parent topic: Automatic JMS client reconnection


Related information