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 » IBM MQ Java / JMS » How to Print MQ Mesaage CorrelationId

Post new topic  Reply to topic
 How to Print MQ Mesaage CorrelationId « View previous topic :: View next topic » 
Author Message
robiijohn
PostPosted: Thu Aug 14, 2008 10:58 pm    Post subject: How to Print MQ Mesaage CorrelationId Reply with quote

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
View user's profile Send private message
David.Partridge
PostPosted: Thu Aug 14, 2008 11:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
David.Partridge
PostPosted: Thu Aug 14, 2008 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Aug 15, 2008 12:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » How to Print MQ Mesaage CorrelationId
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.