Author |
Message
|
svadali |
Posted: Wed Dec 08, 2010 9:40 am Post subject: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
Hi,
Can anyone tell me how I can get a message in hex. I tried it using MA01 Support Pac with the following syntax
./q -lmqic32 -iQueueName -L1 -dh
This gives me the message in HEX but there is also XML message included in this. I just need the message in HEX without the XML.
Please let me know if you have any suggestions/thoughts on this. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Dec 08, 2010 11:00 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
I'm not sure I understand what it is you want. When you get a message, you always get the MQMD and the application data. All of this is hex/ascii.
The supplied utility amqsbcg displays the MQMD; and also the app data in hex and its decimal equivalent. _________________ 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 |
|
 |
svadali |
Posted: Wed Dec 08, 2010 11:16 am Post subject: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
bruce2359 wrote: |
I'm not sure I understand what it is you want. When you get a message, you always get the MQMD and the application data. All of this is hex/ascii.
The supplied utility amqsbcg displays the MQMD; and also the app data in hex and its decimal equivalent. |
The following is the example of the part of the message I get if i used the command
./q -lmqic32 -iQueueName -L1 -dh
Code: |
+00000000 3C3F786D 6C207665 7273696F 6E3D2231 2E302220 <?xml version="1.0"
+00000014 656E636F 64696E67 3D225554 462D3822 203F3E3C encoding="UTF-8" ?><
+00000028 44697370 6F736974 696F6E41 6E645365 6E74656E Dn
+0000003C 63652078 6D6C6E73 3D226874 74703A2F 2F686F6D ce xmlns="http://home |
As you can see in the above message, apart from the hex I see teh XML message too at the end. I dont want that. I hope you got what I am talking about.
Please let me know if you have any solution for this. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 08, 2010 11:25 am Post subject: Re: Get message in HEX |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
svadali wrote: |
As you can see in the above message, apart from the hex I see teh XML message too at the end. |
If by "at the end" you mean "over on the right hand side" then that's just how that application sends output to stdout when you use -dh. It's not how the message is being read off.
Why would you want the raw hex (without the ASCII) displayed? Normally raw data is placed to a file. Perhaps if you explained what you were trying to achieve? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
svadali |
Posted: Wed Dec 08, 2010 12:00 pm Post subject: Re: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
Vitor wrote: |
svadali wrote: |
As you can see in the above message, apart from the hex I see teh XML message too at the end. |
If by "at the end" you mean "over on the right hand side" then that's just how that application sends output to stdout when you use -dh. It's not how the message is being read off.
Why would you want the raw hex (without the ASCII) displayed? Normally raw data is placed to a file. Perhaps if you explained what you were trying to achieve? |
What I wanted to do is, get the message in hex off of MQ and put it in the database. We use informix database and the column I am going to put this message is a BLOB type. Perhaps if there is another way of doing this? I appreciate your help. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 08, 2010 12:03 pm Post subject: Re: Get message in HEX |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
svadali wrote: |
Perhaps if there is another way of doing this? |
How about using MA01 to unload the message to a file and using that rather than scrapeing the screen to obtain the data?
Or modifying one of the supplied samples to read the queue and write the message directly into your database?
Many possibilities exist. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
svadali |
Posted: Wed Dec 08, 2010 12:07 pm Post subject: Re: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
Vitor wrote: |
svadali wrote: |
Perhaps if there is another way of doing this? |
Or modifying one of the supplied samples to read the queue and write the message directly into your database?
Many possibilities exist. |
Do you mind explaining me what you mean by this? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Dec 08, 2010 12:11 pm Post subject: Re: Get message in HEX |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
svadali wrote: |
Do you mind explaining me what you mean by this? |
I'm not sure how much clearer I can be in explaination, aside from repeating that you could modify one of the samples that come with the product to insert the message contents into your database. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 08, 2010 12:29 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You need to write a real application program to do this.
You will need to write a program that can read the message from the queue. This *will* give you a blob value, if you ask it to.
You then need to code this same program to insert data into Informix.
You can't do this with a script, it must be a real program. |
|
Back to top |
|
 |
svadali |
Posted: Wed Dec 08, 2010 12:36 pm Post subject: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
Okay Thank you both for helping me. I am planning to write a program. Lets see how it goes Thought it would be easy if I do it using a script. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Dec 08, 2010 12:58 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Keep in mind that the message you get from a queue contains MQMD and the application data payload. The sample utilities display (for your entertainment) the human-readable data on the right-side, and the hex/ascii equivalent on the left side. A typical application will not do this. _________________ 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 |
|
 |
svadali |
Posted: Thu Dec 09, 2010 6:25 am Post subject: Get message in HEX |
|
|
Novice
Joined: 01 Dec 2010 Posts: 10
|
bruce2359 wrote: |
Keep in mind that the message you get from a queue contains MQMD and the application data payload. The sample utilities display (for your entertainment) the human-readable data on the right-side, and the hex/ascii equivalent on the left side. A typical application will not do this. |
Sure  |
|
Back to top |
|
 |
|