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 IBM MQ Support » Browsing MQ messages with better readability

Post new topic  Reply to topic
 Browsing MQ messages with better readability « View previous topic :: View next topic » 
Author Message
krypton
PostPosted: Mon Aug 27, 2018 7:57 am    Post subject: Browsing MQ messages with better readability Reply with quote

Disciple

Joined: 14 Mar 2010
Posts: 186

While I was browsing MQ message using /opt/mqm/samp/bin amqsbcg command. I got the below format.
The payload part came in 2 format - Hex and the text, is there a way to only print "Text"format , I don't see a option to do that.
Can anyone help me out to find a better way to browse MQ message without actually paying for a third party tool.

MQGET of message number 23, CompCode:0 Reason:0
****Message descriptor****

StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 1208
Format : 'MQSTR '
Priority : 4 Persistence : 1
MsgId : X'414D5120454149544947573120202020E16BC05AF658AB20'
CorrelId : X'414D5120454149544947573120202020E16BC05AF658AB20'
BackoutCount : 0
ReplyToQ : 'GET_KRYPTON_ANSWER_REP '
ReplyToQMgr : 'IBMMQQMGR1 '
** Identity Context
UserIdentifier : 'mqkrypton '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000'
ApplIdentityData : 'JMSListenerApplIdentityData '
** Origin Context
PutApplType : '28'
PutApplName : 'MQBrokerMessageReceiver '
PutDate : '20180420' PutTime : '08545658'
ApplOriginData : ' '

GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'

**** Message ****

length - 2591 of 2591 bytes

00000000: 3C3F 786D 6C20 7665 7273 696F 6E3D 2231 '<?xml version="1'
00000010: 2E30 2220 656E 636F 6469 6E67 3D22 7574 '.0" encoding="ut'
00000020: 662D 3822 3F3E 3C4D 6573 7361 6765 3E3C 'f-8"?><Message><'
00000030: 4443 5348 3E3C 4865 6164 6572 5665 7273 'DCSH><HeaderVers'
00000040: 696F 6E3E 312E 303C 2F48 6561 6465 7256 'ion>1.0</HeaderV'
00000050: 6572 7369 6F6E 3E3C 5265 7175 6573 7469 'ersion><Requesti'
00000060: 6E67 5379 7374 656D 3E43 4C4E 4B3C 2F52 'ngSystem>ABCD</R'
00000070: 6571 7565 7374 696E 6753 7973 7465 6D3E 'equestingSystem>'
00000080: 3C52 6570 6C79 466F 726D 6174 3E58 4D3C '<ReplyFormat>AB<'
00000090: 2F52 6570 6C79 466F 726D 6174 3E3C 6945 '/ReplyFormat><i'
000000A0: 4F53 4F57 466C 6167 3E30 3C2F 6945 4F53 'ABFlag>0</i'

000000B0: 4F57 466C 6167 3E3C 586C 6174 6552 6571 'ABFlag>
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 27, 2018 9:21 am    Post subject: Re: Browsing MQ messages with better readability Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

krypton wrote:
Can anyone help me out to find a better way to browse MQ message without actually paying for a third party tool.


That's not strictly a tool, that's a piece of sample code. It would be fairly straightforward to modify the code to do it (though the option does not exist in the sample code as IBM provides it)

There are a fair variety of free 3rd party tools; the contents of the old IH03 support pac is what I've been using for decades.

<plug>Roger has a good list on his site</plug>
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Aug 27, 2018 10:51 am    Post subject: Reply with quote

Poobah

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

Have you tried the other supplied utilities, like amqsget and amqsgbr?
_________________
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: Mon Aug 27, 2018 3:51 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
Location: Melbourne, Australia

You could try recompiling amqsbcg.c with the following mods:
- Change "#define CHARS_PER_LINE 16" to 64 (or other suitable value)
- Remove 2 lines of code "printf("%02X",Buffer[ch] );"
- Remove the 2 sections of code that have header comments:
/* pad with blanks to format the last line correctly */
/* leave extra space between columns if MBCS characters possible */
_________________
Glenn
Back to top
View user's profile Send private message
krypton
PostPosted: Tue Aug 28, 2018 1:10 pm    Post subject: Reply with quote

Disciple

Joined: 14 Mar 2010
Posts: 186

bruce2359 wrote:
Have you tried the other supplied utilities, like amqsget and amqsgbr?


hi bruce, thank you for providing this information. I didn't try amqsget for the fear that I may lose the queue message with it but amqsgbr did the job. it printed the xml data message in readable format which is what I exactly wanted.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Aug 28, 2018 1:20 pm    Post subject: Reply with quote

Poobah

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

krypton wrote:
bruce2359 wrote:
Have you tried the other supplied utilities, like amqsget and amqsgbr?
I didn't try amqsget for the fear that I may lose the queue message

Yes, the amqsget and amqsgetc supplied utilities do a destructive consume of messages from the queue. As mentioned earlier by my esteemed colleaguer, you have the source code for many supplied sample apps; so you can modify them to meet your needs.
_________________
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 Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Browsing MQ messages with better readability
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.