{"id":6516,"date":"2017-03-02T11:21:16","date_gmt":"2017-03-02T03:21:16","guid":{"rendered":"http:\/\/rmohan.com\/?p=6516"},"modified":"2017-03-02T11:21:16","modified_gmt":"2017-03-02T03:21:16","slug":"dead-letter-queues","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6516","title":{"rendered":"Dead-letter queues"},"content":{"rendered":"<p>Dead-letter queues<br \/>\nA dead-letter (undelivered-message) queue is a queue that stores messages that cannot be routed to their correct destinations.<br \/>\nThis occurs when, for example, the destination queue is full. The supplied dead-letter queue is called SYSTEM.DEAD.LETTER.QUEUE.<br \/>\nFor distributed queuing, define a dead-letter queue on each queue manager involved.<\/p>\n<p>It is defined on the queue manager in the queue to be saved if the message can not be stored in the specified destination.<br \/>\nAs an example it is stored in the dead-letter queue if the destination is queueful.<br \/>\nIf you can not put it in the Dead-letter queue, the channel stops and the message remains in the transmission queue.<\/p>\n<p>Dead-letter queue definition<\/p>\n<p>We have already defined the Dead-letter queue called DLQ at the previous article (distributed queuing).<\/p>\n<p>DEF QL (DLQ) REPLACE<br \/>\nALTER QMGR DEADQ (DLQ)<\/p>\n<p>In the case of<br \/>\nDEF QL (DLQ) REPLACE<br \/>\nALTER QMGR DEADQ (DLQ)<\/p>\n<p>Check dead-letter queue operation<\/p>\n<p>By putting QL.A put on DISABLED on the queue manager QMW to create a state that can not be put into QL.A and sending a message from QMC, the message is stored in the Dead-letter queue on the QMW .<\/p>\n<p>As a preparatory step, execute the following command on QMW on the mqsc interface.<\/p>\n<p>CLEAR QL (QL.A)<br \/>\n15: CLEAR QL (QL.A)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nCLEAR QL (QL.B)<br \/>\n16: CLEAR QL (QL.B)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nCLEAR QL (DLQ)<br \/>\n17: CLEAR QL (DLQ)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nALTER QL (QL.A) PUT (DISABLED)<br \/>\n18: ALTER QL (QL.A) PUT (DISABLED)<br \/>\nAMQ 800: WebSphere MQ queue changed.<br \/>\nIn the case of<br \/>\nCLEAR QL (QL.A)<br \/>\n15: CLEAR QL (QL.A)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nCLEAR QL (QL.B)<br \/>\n16: CLEAR QL (QL.B)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nCLEAR QL (DLQ)<br \/>\n17: CLEAR QL (DLQ)<br \/>\nAMQ 8022: WebSphere MQ queue cleared.<br \/>\nALTER QL (QL.A) PUT (DISABLED)<br \/>\n18: ALTER QL (QL.A) PUT (DISABLED)<br \/>\nAMQ 800: WebSphere MQ queue changed.<\/p>\n<p>Subsequently, from QMC put the message in amqsput to the remote queue definition (referring to QL.A in QMW).<\/p>\n<p>$ Amqsput QRMT.A QMC<br \/>\nSample AMQSPUT 0 start<br \/>\nTarget queue is QRMT.A<br \/>\nI send a message from QMC.<\/p>\n<p>Sample AMQSPUT 0 end<br \/>\n$ Amqsbcg QL.A QMW<\/p>\n<p>AMQSBCG 0 &#8211; starts here<br \/>\n**********************<\/p>\n<p>MQOPEN &#8211; &#8216;QL.A&#8217;<\/p>\n<p>No more messages<br \/>\nMQCLOSE<br \/>\nMQDISC $<\/p>\n<p>$ Amqsput QRMT.A QMC<br \/>\nSample AMQSPUT 0 start<br \/>\nTarget queue is QRMT.A<br \/>\nI send a message from QMC.<\/p>\n<p>Sample AMQSPUT 0 end<br \/>\n$ Amqsbcg QL.A QMW<\/p>\n<p>AMQSBCG 0 &#8211; starts here<br \/>\n**********************<\/p>\n<p>MQOPEN &#8211; &#8216;QL.A&#8217;<\/p>\n<p>No more messages<br \/>\nMQCLOSE<br \/>\nMQDISC $<br \/>\n$<\/p>\n<p>However, since QL.A on QMW can not be PUT, the message does not reach QL.A, and the message is stored in the dead-letter queue.<\/p>\n<p>DIS QL (DLQ) CURDEPTH<br \/>\n19: DIS QL (DLQ) CURDEPTH<br \/>\nAMQ 8409: Display Queue details.<br \/>\nQUEUE (DLQ) TYPE (QLOCAL)<br \/>\nCURDEPTH (1)<\/p>\n<p>In the case of<br \/>\nDIS QL (DLQ) CURDEPTH<br \/>\n19: DIS QL (DLQ) CURDEPTH<br \/>\nAMQ 8409: Display Queue details.<br \/>\nQUEUE (DLQ) TYPE (QLOCAL)<br \/>\nCURDEPTH (1)<\/p>\n<p>Use amqsbcg to check the Dead-letter header.<\/p>\n<p>$ Amqsbcg DLQ QMW<\/p>\n<p>AMQSBCG 0 &#8211; starts here<br \/>\n**********************<\/p>\n<p>MQOPEN &#8211; &#8216;DLQ&#8217;<\/p>\n<p>MQGET of message number 1<br \/>\n**** Message descriptor ****<\/p>\n<p>StrucId: &#8216;MD&#8217; Version: 2<br \/>\nReport: 0 Msg Type: 8<br \/>\nExpiry: -1 Feedback: 0<br \/>\nEncoding: 546 CodedCharSetId: 819<br \/>\nFormat: &#8216;MQDEAD&#8217;<br \/>\nPriority: 0 Persistence: 0<br \/>\nMsgId: X&#8217;414D5120514D432020202020202020209093F25002510020 &#8216;<br \/>\nCorrelId: X&#8217;00000000000000000000000000000000000000000000000000 &#8216;<br \/>\nBackoutCount: 0<br \/>\nReplyToQ: &#8221;<br \/>\nReplyToQMgr: &#8216;QMC&#8217;<br \/>\n** Identity Context<br \/>\nUserIdentifier: &#8216;mqm&#8217;<br \/>\nAccountingToken:<br \/>\nX&#8217;0334393600000000000000000000000000000000000000000000000000000006 &#8216;<br \/>\nApplIdentityData: &#8221;<br \/>\n** Origin Context<br \/>\nPutAppl Type: &#8216;6&#8217;<br \/>\nPutApplName: &#8216;amqsput&#8217;<br \/>\nPutDate: &#8216;20130114&#8217; PutTime: &#8216;11241665&#8217;<br \/>\nApplOriginData: &#8221;<\/p>\n<p>GroupId: X&#8217;00000000000000000000000000000000000000000000000000 &#8216;<br \/>\nMsgSeqNumber: &#8216;1&#8217;<br \/>\nOffset: &#8216;0&#8217;<br \/>\nMsgFlags: &#8216;0&#8217;<br \/>\nOriginalLength: &#8216;-1&#8217;<\/p>\n<p>**** Message ****<\/p>\n<p>Length &#8211; 198 bytes<\/p>\n<p>00000000: 444 C 4820 0100 0000 0308 0000 514 C 2 E 41 &#8216;DLH &#8230;&#8230;.. QL. A&#8217;<br \/>\n00000010: 2020 2020 2020 2020 2020 2020 2020 2020 &#8221;<br \/>\n00000020: 2020 2020 2020 2020 2020 2020 2020 2020 &#8221;<br \/>\n00000030: 2020 2020 2020 2020 2020 2020 514 D 5720 &#8216;QMW&#8217;<br \/>\n00000040: 2020 2020 2020 2020 2020 2020 2020 2020 &#8221;<br \/>\n00000050: 2020 2020 2020 2020 2020 2020 2020 2020 &#8221;<br \/>\n00000060: 2020 2020 2020 2020 2020 2020 2202 0000 &#8216;&#8221;&#8230;&#8217;<br \/>\n00000070: 3303 0000 4D51 5354 5220 2020 0600 0000 &#8216;3 &#8230; MQSTR &#8230;.&#8217;<br \/>\n00000080: 616 D 7172 6 D 70 7061 2020 2020 2020 2020 &#8216;amqrmppa&#8217;<br \/>\n00000090: 2020 2020 2020 2020 2020 2020 3230 3133 &#8216;2013&#8217;<br \/>\n000000 A0: 3031 3134 3131 3234 3236 3737 4920 7365 &#8216;011411242677 I se&#8217;<br \/>\n000000B0: 6E64 2061 206D 6573 7361 6765 2066 726 F &#8216;nd a message fro&#8217;<br \/>\n000000C0: 6D20 514D 432E &#8216;m QMC.&#8217;<\/p>\n<p>No more messages<br \/>\nMQCLOSE<br \/>\nMQDISC $<\/p>\n<p>In the case of<br \/>\n$ Amqsbcg DLQ QMW<\/p>\n<p>AMQSBCG 0 &#8211; starts here<br \/>\n**********************<\/p>\n<p>MQOPEN &#8211; &#8216;DLQ&#8217;<\/p>\n<p>MQGET of message number 1<br \/>\n**** Message descriptor ****<\/p>\n<p>StrucId: &#8216;MD&#8217; Version: 2<br \/>\nReport: 0 Msg Type: 8<br \/>\nExpiry: -1 Feedback: 0<br \/>\nEncoding: 546 CodedCharSetId: 819<br \/>\nFormat: &#8216;MQDEAD&#8217;<br \/>\nPriority: 0 Persistence: 0<br \/>\nMsgId: X&#8217;414D5120514D432020202020202020209093F25002510020 &#8216;<br \/>\nCorrelId: X&#8217;00000000000000000000000000000000000000000000000000 &#8216;<br \/>\nBackoutCount: 0<br \/>\nReplyToQ: &#8221;<br \/>\nReplyTo<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dead-letter queues A dead-letter (undelivered-message) queue is a queue that stores messages that cannot be routed to their correct destinations. This occurs when, for example, the destination queue is full. The supplied dead-letter queue is called SYSTEM.DEAD.LETTER.QUEUE. For distributed queuing, define a dead-letter queue on each queue manager involved.<\/p>\n<p>It is defined on the queue [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[57],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6516"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6516"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6516\/revisions"}],"predecessor-version":[{"id":6517,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6516\/revisions\/6517"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}