Reading DEAD Messages ,find reason code & restoring

Coping DEADQ message back to original queue for transit and Application processing .

Find out the the DeadQ and curdepth

dis qmgr DEADQ
     1 : dis qmgr DEADQ
AMQ8408I: Display Queue Manager details.
   QMNAME(GWQM)                            DEADQ(DEADQL)


DISPLAY QLOCAL(DEADQL) CURDEPTH
     2 : DISPLAY QLOCAL(DEADQL) CURDEPTH
AMQ8409I: Display Queue details.
   QUEUE(DEADQL)                           TYPE(QLOCAL)
   CURDEPTH(300)  

Now browse the messages to see the Reason code on the Dead message To prevent message going to Deadq again by taking precautionary steps.

/opt/mqm/samp/bin/amqsbcg DEADQL GWQM >/tmp/deadqmsg.txt 

Take one message from browsed message .To understand the Reason code.

****Message descriptor****

  StrucId  : 'MD  '  Version : 2
  Report   : 0  MsgType : 8
  Expiry   : -1  Feedback : 0
  Encoding : 546  CodedCharSetId : 1208
  Format : 'MQDEAD  '
  Priority : 0  Persistence : 0
  MsgId : X'414D512046523120202020202020202076A6F15F2BE77C20'
  CorrelId : X'000000000000000000000000000000000000000000000000'
  BackoutCount : 0
  ReplyToQ       : '                                                '
  ReplyToQMgr    : 'FR1                                             '
  ** Identity Context
  UserIdentifier : 'mqm         '
  AccountingToken : 
   X'0339393200000000000000000000000000000000000000000000000000000006'
  ApplIdentityData : '                                '
  ** Origin Context
  PutApplType    : '6'
  PutApplName    : 'amqsput                     '
  PutDate  : '20210103'    PutTime  : '11140179'
  ApplOriginData : '    '

  GroupId : X'000000000000000000000000000000000000000000000000'
  MsgSeqNumber   : '1'
  Offset         : '0'
  MsgFlags       : '0'
  OriginalLength : '-1'
 
****   Message      ****
 
 length - 184 of 184 bytes
 
00000000:  444C 4820 0100 0000 2708 0000 5245 5320           'DLH ....'...RES '
00000010:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000020:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000030:  2020 2020 2020 2020 2020 2020 4757 514D           '            GWQM'
00000040:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000050:  2020 2020 2020 2020 2020 2020 2020 2020           '                '
00000060:  2020 2020 2020 2020 2020 2020 2202 0000           '            "...'
00000070:  B804 0000 4D51 5354 5220 2020 0600 0000           '....MQSTR   ....'
00000080:  616D 7172 6D70 7061 2020 2020 2020 2020           'amqrmppa        '
00000090:  2020 2020 2020 2020 2020 2020 3230 3231           '            2021'
000000A0:  3031 3033 3131 3134 3031 3739 5465 7374           '010311140179Test'
000000B0:  204D 5347 2031 3030                               ' MSG 100        '

Locate the dead letter header. The dead letter header starts with the characters “DLH”.Below is the on from above message.

00000000:  444C 4820 0100 0000 2708 0000 5245 5320           'DLH ....'...RES '

Go to 1st row where ‘DLH ….’ is there and pick 5 column [2708] –> Read the values in the order 3,4,1,2 now it is 0827

Convert current value Hex to Decimal https://www.rapidtables.com/convert/number/hex-to-decimal.html

Hex to Decimal conversion
[mqm@ip-172-31-14-154 ~]$ mqrc 2087

      2087  0x00000827  MQRC_UNKNOWN_REMOTE_Q_MGR
[mqm@ip-172-31-14-154 ~]$ 

Actually when i define RQ RQMNAME was blank hence the message is routed there . Now i will try to put the message back to RQ so it will be send to destination .

Root cause was identified now to restore the messages back to original queue use dmpmqmsg -m GWQM -i DEADQL -o REC -h

[mqm@ip-172-31-14-154 bin]$ cd /opt/mqm/bin
[mqm@ip-172-31-14-154 bin]$ ./dmpmqmsg -m GWQM -i DEADQL -o RES -h

5724-H72 (C) Copyright IBM Corp. 1994, 2020.
IBM MQ Queue Load/Unload Utility
Read    - Files:   0  Messages:300  Bytes:54876
Written - Files:   0  Messages:300  Bytes:3276
[mqm@ip-172-31-14-154 bin]$

<p>AMQ8409I: Display Queue details.<br>QUEUE(RES) TYPE(QLOCAL)5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager APPQM1.

     1 : dis ql(*) where ( curdepth gt 100)
AMQ8409I: Display Queue details.
   QUEUE(RES)                              TYPE(QLOCAL)
   CURDEPTH(300)                 

We have successfully restored the messages now .

Hope this clarified how to check the reason code for message going to DEADQ and how to restore the message to original queue .

Note: dmpmqmsg will copy the messages doesn’t clear DEADQ . We can clear later from DEADQ once application processed .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *