Author |
Message
|
cra1gl1 |
Posted: Wed Apr 25, 2018 7:31 am Post subject: When does a message go to a DLQ? |
|
|
Apprentice
Joined: 25 Apr 2018 Posts: 30
|
Hello,
I'm trying to understand some basic concepts of MQ.
I know a DLQ is used to hold undelivered messages. So when a channel can't put the msgs to the destination queue on the remote qmgr, it drops it in a dlq.
Now, when i use amqsput to put a msg to a queue and lets say the queue is put disabled or full, does the qmgr put the message to the dlq? I tried this by putting msgs to a alias and its local queue and in both cases I get mqrc errors like 2051 or 2053. what needs to be done to have the qmgr to put the msg to dlq ? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 25, 2018 7:45 am Post subject: Re: When does a message go to a DLQ? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cra1gl1 wrote: |
Now, when i use amqsput to put a msg to a queue and lets say the queue is put disabled or full, does the qmgr put the message to the dlq? |
No.
cra1gl1 wrote: |
what needs to be done to have the qmgr to put the msg to dlq ? |
Nothing - it won't do it.
Consider the message as a letter going through the postal service. If the letter can't be delivered because the mailbox is full or nailed shut, the letter goes to the dead letter office for it to be picked up later. If the letter can't be sent in the first place, the message doesn't go to the dead letter office; the guy posting the letter realizes it doesn't work.
So in this instance, the application is trying to post a message and is being told the message can't be accepted. Same way it would be notified if the queue manager was down (2059), non-existent (2058) or if it was trying to put to a queue that didn't exist at all (2085). How the application responds to that is part of application design.
The DLQ is designed to handle the scenario where the message has been accepted, the application has wandered off to do the next thing and the message has arrived somewhere the application has no knowledge of or capacity to handle. So the software uses the DLQ. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 25, 2018 7:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
In the same way successfully putting a message to a queue doesn't mean the target application has processed it; it just means the postal service has put the message in the target mailbox. It could be hours, days or weeks before someone comes out of the house to connect it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cra1gl1 |
Posted: Wed Apr 25, 2018 7:53 am Post subject: |
|
|
Apprentice
Joined: 25 Apr 2018 Posts: 30
|
Thanks for your quick response.
I was reading IBM manual and it says
"Messages can be put on the DLQ by queue managers, message channel agents (MCAs), and applications".
I understand the first 2 cases, but how/when does an application put the msgs to DLQ? |
|
Back to top |
|
 |
mvic |
Posted: Wed Apr 25, 2018 7:59 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
cra1gl1 wrote: |
how/when does an application put the msgs to DLQ? |
The programmer of the application is free to put a message to a DLQ, or not, as per the design of the application. |
|
Back to top |
|
 |
cra1gl1 |
Posted: Wed Apr 25, 2018 8:25 am Post subject: |
|
|
Apprentice
Joined: 25 Apr 2018 Posts: 30
|
mvic wrote: |
The programmer of the application is free to put a message to a DLQ, or not, as per the design of the application. |
why does a app need to put msgs directly to dlq? I thought dlq is purely for MQ software usage. |
|
Back to top |
|
 |
mvic |
Posted: Wed Apr 25, 2018 8:37 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Apr 25, 2018 8:42 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
mvic wrote: |
You have to add a correctly-formed Dead Letter Header at the top of your message - otherwise MQPUT to the DLQ will fail and/or your dead letter handler program might have trouble. |
A DLH is not required to successfully MQPUT a message in the DLQ. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Apr 25, 2018 8:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cra1gl1 wrote: |
mvic wrote: |
The programmer of the application is free to put a message to a DLQ, or not, as per the design of the application. |
why does a app need to put msgs directly to dlq? I thought dlq is purely for MQ software usage. |
Your site might want to handle messages that cause application errors using the same mechanism they handle undeliverable messages. It's not something I would personally endorse, but it can be done and I've seen it done.
bruce2359 wrote: |
A DLH is not required to successfully MQPUT a message in the DLQ |
But it is required if you're using the out of the box dead letter handler or any of the commercial dead letter handlers, all of which expect the message to have a DLH. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Apr 25, 2018 9:22 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Vitor wrote: |
bruce2359 wrote: |
A DLH is not required to successfully MQPUT a message in the DLQ |
But it is required if you're using the out of the box dead letter handler or any of the commercial dead letter handlers, all of which expect the message to have a DLH. |
The last rule could/should be one that moves any residual (non-matched) msgs off to a REALLY.DEAD.QUEUE or some such. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Apr 25, 2018 6:07 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Provided they have +put MQ authority, apps can open the qmgr's DLQ and put messages, with or without a DLH.
However, I don't think this is a good idea. The DLQ handler will need to have rules to process the messages, and this creates an app dependency in qmgr operation and housekeeping.
I think its better for apps to have their own dedicated DLQ's with their own handlers. _________________ Glenn |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 26, 2018 2:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gbaddeley wrote: |
Provided they have +put MQ authority, apps can open the qmgr's DLQ and put messages, with or without a DLH.
However, I don't think this is a good idea. The DLQ handler will need to have rules to process the messages, and this creates an app dependency in qmgr operation and housekeeping.
I think its better for apps to have their own dedicated DLQ's with their own handlers. |
Apps running JMS or XMS need access to the DLQ. If there is no Back Out Queue defined the JMS/XMS client will try to put the message to the DLQ if the backout threshold has been reached... (and yes it will have a DLH)  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Apr 26, 2018 4:32 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
fjb_saper wrote: |
Apps running JMS or XMS need access to the DLQ. If there is no Back Out Queue defined the JMS/XMS client will try to put the message to the DLQ if the backout threshold has been reached... (and yes it will have a DLH)  |
I am aware of this. These apps should define a BOQ, to avoid using the DLQ. As an MQ admin, I don't want to be alerted for any app msgs cluttering up the DLQ, as its not my responsibility to deal with these (other than tell the app support team). _________________ Glenn |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 26, 2018 5:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gbaddeley wrote: |
fjb_saper wrote: |
Apps running JMS or XMS need access to the DLQ. If there is no Back Out Queue defined the JMS/XMS client will try to put the message to the DLQ if the backout threshold has been reached... (and yes it will have a DLH)  |
I am aware of this. These apps should define a BOQ, to avoid using the DLQ. As an MQ admin, I don't want to be alerted for any app msgs cluttering up the DLQ, as its not my responsibility to deal with these (other than tell the app support team). |
Glenn I was aware that you knew that. This was more for the benefit of the OP who might not have known this little quirk. After all we (the few) are not the only ones reading this forum...
And to go one step further : it is the responsibility of the app to request for correct monitoring of their backout queues, so you don't have to tell them anything...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Apr 27, 2018 4:44 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
gbaddeley wrote: |
I don't want to be alerted for any app msgs cluttering up the DLQ, as its not my responsibility to deal with these (other than tell the app support team). |
For the benefit of the OP:
MQ implements application triggering, so that when a message arrives on a queue - in this case the DLQ, a supplied Dead Letter Handler application can move messages out of the DLQ to a app-specified queue for special handling. The app-specified queue can also be triggered to start a app-specific special handling app to do whatever is required with the message.
You might want to be notified if the DLQ, which is usually empty during normal processing, suddenly reaches a certain depth. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|