Author |
Message
|
vmanel |
Posted: Sat Sep 14, 2019 5:24 am Post subject: dmpmqmsg: readable format |
|
|
Acolyte
Joined: 12 Mar 2019 Posts: 57
|
Hi,
Is there a way to save messages from queue to file using dmqmqmsg in complete human readable format? Just like Rfhutilc or MQ visual edit?
I tried using options like -dp or -dt but the message is partially in readable format. Also this option says its not code page safe. So is there a way to save these messages in complete readable format and then use that to load to another queue?
Thanks |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Sep 14, 2019 5:43 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Please post what you see as unreadable.
Use amqsbcg or amqsgbr to display a message, then post here. _________________ 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 |
|
 |
vmanel |
Posted: Sat Sep 14, 2019 9:23 am Post subject: |
|
|
Acolyte
Joined: 12 Mar 2019 Posts: 57
|
bruce2359 wrote: |
Please post what you see as unreadable.
Use amqsbcg or amqsgbr to display a message, then post here. |
Unreadable means its in hexadecimal format, not in original format(such as an readable xml message with tags). I just wanted to know if its possible to do that using dmpmqmsg. Because I want to use that as alternative to Rfhutilc or mq visual edit as they are too slow for thousands of messages |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Sep 14, 2019 12:42 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The MQMD should be readable. Please be precise. Is it just your app data payload that is unreadable, but the MQMD is in clear text?
Hex is readable. amqsbcg will display the MQMD and your app data. Please display one message - we don't need to see thousands. _________________ 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 |
|
 |
hughson |
Posted: Mon Sep 16, 2019 11:11 pm Post subject: Re: dmpmqmsg: readable format |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
vmanel wrote: |
I tried using options like -dp or -dt but the message is partially in readable format. |
If the message is only partially readable when you use these options, then that would imply that not all the message was readable - which is why there is a warning associated with it.
Perhaps you can show us an example of what you mean by partially readable too?
The only way to be sure to get exactly the same message back on a queue after reloading it from a file is to use hex.
-dp and -dt are there to allow you to read it if you only need to view the messages and don't need to reload an exact copy later.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
pakuma3 |
Posted: Wed Sep 18, 2019 12:55 pm Post subject: |
|
|
Newbie
Joined: 27 Feb 2015 Posts: 9
|
I believe he means getting the same message back.
For example I loaded messages (1 msg per line in a text file) using ampsput TESTQ QM1 < TESTFILE.TXT
The closest to the original file I can get is with amqsget but it still ads:
Sample AMQSGET0 start
message <
...
>
no more messages
Sample AMQSGET0 end
And browse adds hex code
I think he means a way to get the headers and descriptors removed from the output file and get the closest thing to his original file, if not the original file.
I have also been looking for a Command Line alternative to RFHUTIL (since you can get the same message by unchecking the Include Headers and Descriptors boxes).
Sorry to eavesdrop  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Sep 18, 2019 4:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pakuma3 wrote: |
I have also been looking for a Command Line alternative to RFHUTIL (since you can get the same message by unchecking the Include Headers and Descriptors boxes). |
The amqsget sample is entirely that - a sample. It's not intended for production use with thousands of messages.
If you want a command line utility that returns just the actual messages without any human readable starting / stopping messages, modify the amqsget sample code to meet the need or write your own in a language of your choice. Such a utility could also do something more useful with the messages than echoing them to the console.....
It's worth pointing out that both RFHUtil and VisualEdit fit in the same class; neither are intended for production strength processing of messages. If you routinely need to save thousands of messages using a utility, something's wrong with your design.
Staying with the topic of "something wrong", if what you're getting back is unreadable because it's unprintable characters, has odd formatting or similar then I agree with my worthy associates; there's a character set problem.
One final side note; if you put an XML document as a message, don't expect it to come back all pretty with one tag on each line. An application putting thousands of XML documents almost certainly won't bother to pretty print them (and many XML parsers lack the ability on serialization) because whitespace (like line feeds) between tags is ignored on parsing. Things like XMLSpy are deliberately parsing the XML and formatting it to make it human readable. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PaulClarke |
Posted: Wed Sep 18, 2019 6:52 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
DMPMQMSG is based on my QLOAD (MO03 SupportPac) program. Since leaving IBM I have continued to enhance QLOAD which now contains lots of new features not in the original program. This is, of course, now a commercial product rather than a free tool but the price is pretty negligible.
Anyway the point of this post is two fold. Firstly, our QLOAD product has another output format -dr which is 'raw' mode. This outputs the messages in as raw a form as possible. This might be closer to what you are looking for. Secondly since we are currently maintaining the QLOAD product we are always interested in hearing of new requirements so if you believe that it doesn't quite do what you want then by all means give us a set of specifications and we can tell you whether it seems doable.
In the meantime if you (or anyone else) are interested in trying out the current QLOAD product and it's new features then feel free to email me at support@mqgem.com
Regards,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Sep 19, 2019 1:59 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
In a bash this script code converts the Hex to Chars:
Code: |
grep '^X ' dmpmqmsg.output | sed "s/^X //" > tmpfile
rm -f dmpmqmsg.converted
cat tmpfile | while read line
do
msg=$line
while [ "$msg" != "" ]
do
char=`echo $msg | cut -c 1,2`
printf "\x$char" >> dmpmqmsg.converted
msg=`echo $msg | cut -c 3-`
done
done
cat dmpmqmsg.converted |
But I'm looking for a "printf" substitution in a Korn-Shell. _________________ Regards
Hubert |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Sep 19, 2019 5:43 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
In the meantime I found a solution for AIX Korn shell:
Code: |
#!/usr/bin/sh
# Specify input queue o command line.
INQUEUE=$1
# Check the command line option.
[ "$INQUEUE" = "" ] && echo "usage `basename $0` in_queue" && exit 1
# Define the output file name.
INFILE=$INQUEUE.out
# Browse first message ('-r 1') as ASCII ('-dA') from queue and write it to the file.
dmpmqmsg -r 1 -dA -m SI1AD001 -i $INQUEUE -F $INFILE > /dev/null 2>&1
# Define the temp file name.
TMPFILE=$INFILE.tmp
# Get the content (lines starting with 'S ').
grep '^S ' $INFILE | sed "s/^S //" > $TMPFILE
mv $TMPFILE $INFILE
# Read the lines from the temp file ...
cat $INFILE | while read line
do
# Remove leading and trailing '"' and newline.
printf "$line" | sed 's/^"//' | sed 's/"$//' >> $TMPFILE
done
# Add a fina newline.
printf "\n" >> $TMPFILE
# Display the message.
cat $TMPFILE
# Remove the files.
rm -f $INFILE $TMPFILE |
This script dumps the first message of a queue (non-destructively) and displays the content.
Of course you may extent the script to read a 2nd, 3rd, ... message . _________________ Regards
Hubert |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Sep 23, 2019 4:28 pm Post subject: Re: dmpmqmsg: readable format |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
vmanel wrote: |
...So is there a way to save these messages in complete readable format and then use that to load to another queue?
Thanks |
It depends on your interpretation of what is "readable" in your MQ messages. Most existing tools adopt a general approach that guarantees messages can be unloaded / loaded on queues. The unload file may or may not be human readable, and for the purposes of loading, it does not matter. Maybe you need a separate program that browses the queue and displays the application specific messages in a readable format, or interprets the unload file. _________________ Glenn |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Mon Sep 23, 2019 9:42 pm Post subject: Re: dmpmqmsg: readable format |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
gbaddeley wrote: |
vmanel wrote: |
...So is there a way to save these messages in complete readable format and then use that to load to another queue?
Thanks |
It depends on your interpretation of what is "readable" in your MQ messages. Most existing tools adopt a general approach that guarantees messages can be unloaded / loaded on queues. The unload file may or may not be human readable, and for the purposes of loading, it does not matter. Maybe you need a separate program that browses the queue and displays the application specific messages in a readable format, or interprets the unload file. |
In the past I had a colleague, who was able to read EBCDIC code on z/OS directly. This guy would say, this "D4 D8 E2 85 99 89 85 A2" is a readable Format . _________________ Regards
Hubert |
|
Back to top |
|
 |
|