ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » When does a message go to a DLQ?

Post new topic  Reply to topic Goto page 1, 2  Next
 When does a message go to a DLQ? « View previous topic :: View next topic » 
Author Message
cra1gl1
PostPosted: Wed Apr 25, 2018 7:31 am    Post subject: When does a message go to a DLQ? Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Apr 25, 2018 7:45 am    Post subject: Re: When does a message go to a DLQ? Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Apr 25, 2018 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
cra1gl1
PostPosted: Wed Apr 25, 2018 7:53 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Wed Apr 25, 2018 7:59 am    Post subject: Reply with quote

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
View user's profile Send private message
cra1gl1
PostPosted: Wed Apr 25, 2018 8:25 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Wed Apr 25, 2018 8:37 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

cra1gl1 wrote:
why does a app need to put msgs directly to dlq? I thought dlq is purely for MQ software usage.

As far as the MQ product is concerned (your site might have a different policy, I don't know) an application programmer is free to put messages to the DLQ (assuming the admin has granted authority). This point is mentioned a couple of times in the links I include below.
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. It can be difficult to write correct code to add headers to the top of messages.
And your site MQ standards documents might have statements about not using a DLQ direct from apps (for that very reason, perhaps).
I found the following from an internet search:
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.pro.doc/q002680_.htm
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.adm.doc/q020730_.htm
https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005540_.htm
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Apr 25, 2018 8:42 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
Vitor
PostPosted: Wed Apr 25, 2018 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Wed Apr 25, 2018 9:22 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
gbaddeley
PostPosted: Wed Apr 25, 2018 6:07 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
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
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 26, 2018 2:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
gbaddeley
PostPosted: Thu Apr 26, 2018 4:32 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
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
View user's profile Send private message
fjb_saper
PostPosted: Thu Apr 26, 2018 5:42 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Fri Apr 27, 2018 4:44 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General Discussion » When does a message go to a DLQ?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.