Understanding WebSphere MQ Reason Codes
I’m new to WebSphere MQ and have been struggling to learn the best way to debug problems. Of particular confusion has been the term “logs.” If you create a persistent queue then every message is persisted in what MQ calls a log. This is dramatically different from the way I usually use the term. When I say log, I usually mean a file that contains trace or debug information. I would call the MQ log a database.
So everytime I search the manual for “log information,” I get nothing that helps me debug a problem. Today however, I did run across a gem of a command, mqrc. As with many legacy applications, MQ displays error or reason codes when an error occurs. So you get a very descriptive “2051″ to help you determine the problem. For a given reason code, mqrc displays the code definition…a real description behind the number. Below is the help for that command.
MQRC Usage:
Interpret a retcode or a number of retcodes in a range
mqrc [-a]
mqrc -r [-a]
mqrc -R [-f -l ] [-a]Interpret a message or a number of messages in a range
mqrc [-a] AMQ
mqrc -m [AMQ] [-a]
mqrc -M -f -l [-a]Interpret a retcode symbol
mqrc
mqrc -sDisplay help
mqrc -h Display this help
mqrc -v Display the version numberWhere the options are:
-a Try all severities to find message text
-f First number in range
-l Last in number range1. Numeric arguments are interpreted as decimal if they start with a
digit 1 to 9, or hex if prefixed with “0x”2. If no range is given when interpreting a range of retcodes, then all
the retcodes are listed.3. When printing retcodes or messages in a range, if there is a problem
with message, an indication is printed just before the message text,
as follows:
‘?’ There are no matching retcodes for this message
‘!’ The message severity is different to the retcode severity