Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display the actual messageid and correlationID

Status
Not open for further replies.

emaster

Programmer
Mar 28, 2002
4
US
Please help!!!

I would like to display the actual messageID from the message I put on the queue and the actual correlationID from the get message...they should be the same. When I attempt this command
System.out.println("put msg"+putmsg.messageId) ;
System.out.println("getmesg"+getmsg.correlationId)

I was told "you are displaying the object
reference (address) of the storage for the MsgId and CorrelId and not the values of these fields" but they did not tell me how to get the values and I am really new to java and mqseries.

Thanks for help in advance.

 
I don't know the exact answer, but I'll take a stab at it. The MQMessage.messageId returns a byte array -> "public byte messageId[]". So my guess is that you'll have to do some manipulation to the byte array element in order to display it in a String format.
 
The messageid is a byte array so I did have to read it using the ByteArrayInputStream..Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top