How to convert MQseries reason code to string?

How do I convert / find the IBM Websphere MQseries reason code to explain it (for logging, etc.)?

+4
source share
3 answers

Refer to SupportPac MA0K , which has C code and Visual Basic for this task.

+3
source

The command line has "mqrc.exe", which comes with MQSeries, which returns the name of a character constant.

And for Java there is MQConstants.lookupReasonCode (reasonCode) which is included in com.ibm.mq.jmqi.jar

+1
source

API IBM Websphere MQ: char *MQRC_STR (MQLONG ReasonCode)

:

    #include <cmqc.h>
    #include <cmqstrc.h>
    typedef MQHCONN QM_REF;

    QM_REF connect(const std::string & QueueManagerName)
    {
        QM_REF theManager_ = -1;

        MQLONG compCode, reasonCode;
        MQCONN(const_cast<char *>(QueueManagerName.c_str()), &theManager_, &compCode, &reasonCode);
        if (MQCC_FAILED == compCode)
        {
            std::cout << "Failed to connect to queue manager. Reason code is:" << MQRC_STR(reasonCode) << std::endl;
        }

        return theManager_;
    }
0

Source: https://habr.com/ru/post/1759560/


All Articles