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 IndexGeneral IBM MQ SupportGetting Failed message info from DLQ without tools

Post new topicReply to topic Goto page 1, 2  Next
Getting Failed message info from DLQ without tools View previous topic :: View next topic
Author Message
kishi_25
PostPosted: Thu Jan 25, 2018 1:08 pm Post subject: Getting Failed message info from DLQ without tools Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

Hi,

Is there anyway we can get Original destination queue name, QM name for the failed Messages in DLQ. I want to get this information without using any support pacs. I was able to use sampel program amqsbcg to get reason code in Hex format and converted it. Similar to this, is there anyway I can get the Original destination queue name and queue manager name?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Jan 25, 2018 2:05 pm Post subject: Re: Getting Failed message info from DLQ without tools Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25016
Location: Ohio, USA

kishi_25 wrote:
Similar to this, is there anyway I can get the Original destination queue name and queue manager name?


These fields are in the same header as the reason code.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kishi_25
PostPosted: Thu Jan 25, 2018 6:47 pm Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

Agree with you. But, the problem is I can read the Reason code from 5 th and 6th byte in fixed place as below. But, getting the queue name and QMGR name from the below message is difficult as they are not coming in fixed place and also coming as separate section next to Hexa values and truncating in multiple lines.

00000000: 444C 4820 0100 0000 EE07 0000 5445 5354 'DLH ........TEST'
00000010: 2E44 4C51 2020 2020 2020 2020 2020 2020 '.DLQ '
00000020: 2020 2020 2020 2020 2020 2020 2020 2020 ' '
00000030: 2020 2020 2020 2020 2020 2020 514D 4447 ' QMDG'
00000040: 3031 4D31 2020 2020 2020 2020 2020 2020 '01M1 '
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jan 26, 2018 5:33 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25016
Location: Ohio, USA

kishi_25 wrote:
But, getting the queue name and QMGR name from the below message is difficult as they are not coming in fixed place


Yes they are. There are no variable length fields in the MQDLH.

kishi_25 wrote:
also coming as separate section next to Hexa values and truncating in multiple lines.


The amqsbcg sample application shows 2 sections - the raw hex of the message and the character representation of that hex (fairly standard for a hex viewer). So it even shows the character representation of the reason code, albeit as a couple of dots indicating the hex doesn't map to a printable character.

If you don't want to use a support pac (and I struggle to think why not), modify the amqsbcg sample to a) display the data differently or b) form the basis of a home - grown DLH handler that not only displays the names as complete strings but converts the reason code for you. And enjoy this new wheel you will have invented.

One of the good things about computers is that they can do things for you, eliminating (as an example) the need to look at the hex dump of a message to figure out why it's on a DLQ.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kishi_25
PostPosted: Fri Jan 26, 2018 7:17 am Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

I'm trying to write a shell script, which should read message from DLQ and gets values of MQRC code, Destination queue name and Queue manager name. For this I started with amqsbcg reading DLQ and putting in a file and from there get the values. For reason code, though it's in hex form, getting mqrc is not straight forward as we need to swap and reverse the hex codes. Now, i'm struck with how to get queue and qm values using a script. I can't use the scrip t with combination of RFHUTIL and MQMON as they are in GUI. other option, I'm thinking is to use script to get these values from qload/dmpmqmsg. Looks like amqsbcg is not in a readable format, so it seems to be cusotmizing is not possible with it. is there any other better option?
Back to top
View user's profile Send private message
kishi_25
PostPosted: Fri Jan 26, 2018 7:36 am Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

Also, it seems we have source code for amqsbcg in other directory with C language. However, i'm looking for other better options instead of customizing it.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Jan 26, 2018 3:00 pm Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8053
Location: US: west coast, almost. Otherwise, enroute.

MQ dead-letter header is well-documented, and contains fixed-position and fixed-length fields. Go to google. Search for 'mqdlh+format'.

Yes, on Intel hardware the RC is bytes must be reversed to reveal the hex-equivalent of the decimal ReasonCode.

Are you an experienced shell-script coder? C programmer? Other?

Search google for 'byte manipulation in shell scripts'.

Search google for 'convert hex to decimal in shell script'.

I'd also recommend that you investigate the IBM-supplied Dead-Letter Handler utility that can deal with DLH messages - like retry, move to another queue, ignore, delete, etc., based on the ReasonCode.
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
kishi_25
PostPosted: Fri Jan 26, 2018 3:15 pm Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

now, I'm trying with dmpmqmsg/shall script combination, which seems to be some what better in fetching these values. C programming I have done way back . So, I want to rely on shell script. DLH, which IBM supplied is doing most of the times retrying and has limitations to act on changing destination queue properties .
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Jan 26, 2018 3:17 pm Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3050
Location: London, ON Canada

kishi_25 wrote:
I'm trying to write a shell script, which should read message from DLQ and gets values of MQRC code, Destination queue name and Queue manager name.

kishi_25 wrote:
I can't use the scrip t with combination of RFHUTIL and MQMON as they are in GUI. other option, I'm thinking is to use script to get these values from qload/dmpmqmsg. Looks like amqsbcg is not in a readable format, so it seems to be cusotmizing is not possible with it. is there any other better option?

Yeah. Why don't you try out MQ Batch Toolkit. Its whole purpose is to be driven from a script and it understands MQ headers like the MQDLH.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Fri Jan 26, 2018 4:22 pm Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25016
Location: Ohio, USA

kishi_25 wrote:
has limitations to act on changing destination queue properties .


Really? What limitations?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kishi_25
PostPosted: Fri Jan 26, 2018 7:45 pm Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

The DLQ Handler provides actions - Discard, Ignore, retry, forward the failed messages... None of these will address the root cause of the issues like Increasing queue depth - for queue full; Increasing message size on Queue - message size issue etc.

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005680_.htm
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jan 29, 2018 6:42 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25016
Location: Ohio, USA

kishi_25 wrote:
The DLQ Handler provides actions - Discard, Ignore, retry, forward the failed messages... None of these will address the root cause of the issues like Increasing queue depth - for queue full; Increasing message size on Queue - message size issue etc.

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005680_.htm


None of these are limitations on changing destination queue properties.

Also increasing queue depth for a queue full event is not addressing the root cause, but obviating the symptoms. If the queue is filling up, the most likely causes are the application responsible for reading messages off is either performing below SLA or has crashed. Hence the hander provides the option to retry the messages once the root application problem is corrected. If the application has crashed, increasing the max depth makes things worse because it hides the problem until you either hit the hard limit for queue depth or run out of disc for the queue file.

I'd also question the wisdom of increasing the max message size on a queue just because you're getting a message that exceeds it. Max message size (like max queue depth) exists as a safety feature to deal with malfunctioning applications. If a message suddenly starts sending messages larger than it used to, I (as MQ admin) would want to know why the behavior has changed before I arbitrarily increased the limit.

If this is all you want your script to do, alter the max message size of all your queues to 100Mb, and the max depth to 99999999999. Requires no coding (unless you script the changes) and will achieve the same result.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Jan 29, 2018 7:21 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 8053
Location: US: west coast, almost. Otherwise, enroute.

While I applaud your technical solution (automating increase in max queue depth and max msg length), it does not address the underlying problem, namely: lack of planning by analysts and developers.

Rather than pursuing your script, I strongly suggest pushing back on the analysts and developers to tell you the precise specifications for max msg size and max queue depth - including growth over time. These are knowable and predictable.
_________________
I would tell you a UDP joke, but you might not get it.
Back to top
View user's profile Send private message
kishi_25
PostPosted: Mon Jan 29, 2018 11:14 am Post subject: Reply with quote

Voyager

Joined: 19 Jul 2011
Posts: 94

Agree that, from MQ admin point of view these are not best solutions. But, in practical scenarios, when we had these scenarios occur in cluster environment, it had trickle-down effect for other applications due to messages accumulating xmit queues for maxdepth issue and max length issue msgs land in dlq. So, the solution i'm trying to implement is to do auto fix temporarily in the sense, auto increase of queue depth and max length temporarily and revert back these values after the issue is resolved and it will send an e-mail to related support team to address the root cause next business day.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jan 29, 2018 11:25 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 25016
Location: Ohio, USA

kishi_25 wrote:
when we had these scenarios occur in cluster environment, it had trickle-down effect for other applications .... it will send an e-mail to related support team to address the root cause next business day.


If this sort of thing causes a problem in a cluster environment, your cluster environment is set up wrong.

If this is the only means you have of detecting a problem within the MQ estate, or application software, then your site has a problem with it's lack of effective monitoring.

"Next business day" is a long time to wait for a support team to respond, and an optimistic time frame for an application team to trace & resolve a problem. Say they've implemented a change that makes their reading application run slow, or worse have changed an application so it sends longer messages intermittently. How long will that take to find, fix and implement into production?

You're putting a Band-Aid on a broken leg.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexGeneral IBM MQ SupportGetting Failed message info from DLQ without tools
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.