April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Dead-letter queues

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.

It is defined on the queue manager in the queue to be saved if the message can not be stored in the specified destination.
As an example it is stored in the dead-letter queue if the destination is queueful.
If you can not put it in the Dead-letter queue, the channel stops and the message remains in the transmission queue.

Dead-letter queue definition

We have already defined the Dead-letter queue called DLQ at the previous article (distributed queuing).

DEF QL (DLQ) REPLACE
ALTER QMGR DEADQ (DLQ)

In the case of
DEF QL (DLQ) REPLACE
ALTER QMGR DEADQ (DLQ)

Check dead-letter queue operation

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 .

As a preparatory step, execute the following command on QMW on the mqsc interface.

CLEAR QL (QL.A)
15: CLEAR QL (QL.A)
AMQ 8022: WebSphere MQ queue cleared.
CLEAR QL (QL.B)
16: CLEAR QL (QL.B)
AMQ 8022: WebSphere MQ queue cleared.
CLEAR QL (DLQ)
17: CLEAR QL (DLQ)
AMQ 8022: WebSphere MQ queue cleared.
ALTER QL (QL.A) PUT (DISABLED)
18: ALTER QL (QL.A) PUT (DISABLED)
AMQ 800: WebSphere MQ queue changed.
In the case of
CLEAR QL (QL.A)
15: CLEAR QL (QL.A)
AMQ 8022: WebSphere MQ queue cleared.
CLEAR QL (QL.B)
16: CLEAR QL (QL.B)
AMQ 8022: WebSphere MQ queue cleared.
CLEAR QL (DLQ)
17: CLEAR QL (DLQ)
AMQ 8022: WebSphere MQ queue cleared.
ALTER QL (QL.A) PUT (DISABLED)
18: ALTER QL (QL.A) PUT (DISABLED)
AMQ 800: WebSphere MQ queue changed.

Subsequently, from QMC put the message in amqsput to the remote queue definition (referring to QL.A in QMW).

$ Amqsput QRMT.A QMC
Sample AMQSPUT 0 start
Target queue is QRMT.A
I send a message from QMC.

Sample AMQSPUT 0 end
$ Amqsbcg QL.A QMW

AMQSBCG 0 – starts here
**********************

MQOPEN – ‘QL.A’

No more messages
MQCLOSE
MQDISC $

$ Amqsput QRMT.A QMC
Sample AMQSPUT 0 start
Target queue is QRMT.A
I send a message from QMC.

Sample AMQSPUT 0 end
$ Amqsbcg QL.A QMW

AMQSBCG 0 – starts here
**********************

MQOPEN – ‘QL.A’

No more messages
MQCLOSE
MQDISC $
$

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.

DIS QL (DLQ) CURDEPTH
19: DIS QL (DLQ) CURDEPTH
AMQ 8409: Display Queue details.
QUEUE (DLQ) TYPE (QLOCAL)
CURDEPTH (1)

In the case of
DIS QL (DLQ) CURDEPTH
19: DIS QL (DLQ) CURDEPTH
AMQ 8409: Display Queue details.
QUEUE (DLQ) TYPE (QLOCAL)
CURDEPTH (1)

Use amqsbcg to check the Dead-letter header.

$ Amqsbcg DLQ QMW

AMQSBCG 0 – starts here
**********************

MQOPEN – ‘DLQ’

MQGET of message number 1
**** Message descriptor ****

StrucId: ‘MD’ Version: 2
Report: 0 Msg Type: 8
Expiry: -1 Feedback: 0
Encoding: 546 CodedCharSetId: 819
Format: ‘MQDEAD’
Priority: 0 Persistence: 0
MsgId: X’414D5120514D432020202020202020209093F25002510020 ‘
CorrelId: X’00000000000000000000000000000000000000000000000000 ‘
BackoutCount: 0
ReplyToQ: ”
ReplyToQMgr: ‘QMC’
** Identity Context
UserIdentifier: ‘mqm’
AccountingToken:
X’0334393600000000000000000000000000000000000000000000000000000006 ‘
ApplIdentityData: ”
** Origin Context
PutAppl Type: ‘6’
PutApplName: ‘amqsput’
PutDate: ‘20130114’ PutTime: ‘11241665’
ApplOriginData: ”

GroupId: X’00000000000000000000000000000000000000000000000000 ‘
MsgSeqNumber: ‘1’
Offset: ‘0’
MsgFlags: ‘0’
OriginalLength: ‘-1’

**** Message ****

Length – 198 bytes

00000000: 444 C 4820 0100 0000 0308 0000 514 C 2 E 41 ‘DLH …….. QL. A’
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 514 D 5720 ‘QMW’
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: 3303 0000 4D51 5354 5220 2020 0600 0000 ‘3 … MQSTR ….’
00000080: 616 D 7172 6 D 70 7061 2020 2020 2020 2020 ‘amqrmppa’
00000090: 2020 2020 2020 2020 2020 2020 3230 3133 ‘2013’
000000 A0: 3031 3134 3131 3234 3236 3737 4920 7365 ‘011411242677 I se’
000000B0: 6E64 2061 206D 6573 7361 6765 2066 726 F ‘nd a message fro’
000000C0: 6D20 514D 432E ‘m QMC.’

No more messages
MQCLOSE
MQDISC $

In the case of
$ Amqsbcg DLQ QMW

AMQSBCG 0 – starts here
**********************

MQOPEN – ‘DLQ’

MQGET of message number 1
**** Message descriptor ****

StrucId: ‘MD’ Version: 2
Report: 0 Msg Type: 8
Expiry: -1 Feedback: 0
Encoding: 546 CodedCharSetId: 819
Format: ‘MQDEAD’
Priority: 0 Persistence: 0
MsgId: X’414D5120514D432020202020202020209093F25002510020 ‘
CorrelId: X’00000000000000000000000000000000000000000000000000 ‘
BackoutCount: 0
ReplyToQ: ”
ReplyTo

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>