|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to Print MQ Mesaage CorrelationId |
« View previous topic :: View next topic » |
Author |
Message
|
robiijohn |
Posted: Thu Aug 14, 2008 10:58 pm Post subject: How to Print MQ Mesaage CorrelationId |
|
|
Newbie
Joined: 13 Aug 2008 Posts: 7
|
Hi All,
How can i Print the correlation Id of the MQ message ......
Since the correlation Id is in the byte format it is not printing the correct value....
Can Anybody help  |
|
Back to top |
|
 |
David.Partridge |
Posted: Thu Aug 14, 2008 11:33 pm Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
So use an appropriate printf pattern to format the hex bytes for display - it is certainly not a string - it's just binary data as far as you are concerned.
If you want to see an example of how to do this look at the source code for amqsbcg (amqsbcg0.c) _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
David.Partridge |
Posted: Thu Aug 14, 2008 11:44 pm Post subject: |
|
|
 Master
Joined: 28 Jun 2001 Posts: 249
|
Sorry, I forgot this the Java/JMS forum, so comments about C code aren't appropriate. You'll need to use some Java code to unpack the bytes and display them.
I'm afraid I don't have a suitable snippet of code to hand on this machine though. _________________ Cheers,
David C. Partridge |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 15, 2008 12:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
use Byte.toHexString and check the length. Prefix with "0" where applicable and add to a StringBuffer. When done you should have a hex representation of the values (-128,+127) or 00 to FF.
And for the reverse operation use Byte.decode("0x"+hex(2))
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|