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 API Support » AMQMDNET Message issue

Post new topic  Reply to topic
 AMQMDNET Message issue « View previous topic :: View next topic » 
Author Message
liviur
PostPosted: Tue Nov 15, 2005 10:03 am    Post subject: AMQMDNET Message issue Reply with quote

Novice

Joined: 15 Nov 2005
Posts: 15

Environment: Win2K, C# program referencing AMQMDNET.dll

Looks like IBM folks forgot to (or didn't want to) port the MessageIdHex property of MQMessage (IBM.WMQAX namespace) to their .Net counterpart implementation (IBM.WMQ namespace).

Any ideas on how to obtain it?
Back to top
View user's profile Send private message
liviur
PostPosted: Thu Nov 17, 2005 6:01 am    Post subject: Got workaround Reply with quote

Novice

Joined: 15 Nov 2005
Posts: 15

Upon further investigation (using ildasm to look at IL in IBM.WMQAX) it turns out MessageIdHex is simply a method to convert the MessageId (byte[]) to string. I should have thought of that since MessageIdHex is not in the MQMD structure... Anyway, if anyone is interested here's a raw version of a utility class I wrote to perform the conversion (sorry for the formatting in this editor)

Code:

internal sealed class MQUtility
{
  static private readonly MQMessage dummyMessage = new MQMessage();
  static private readonly int MQMessageIdLen = dummyMessage.MessageId.GetLength(0);

internal static string MessageIdHex(MQMessage msg)
{         
  StringBuilder sb = new StringBuilder(MQMessageIdLen * 2); // hex representation of each byte; 2 digit wide
  foreach(byte b in msg.MessageId)
  {
    sb.AppendFormat("{0,2:X}", b);
  }
  return sb.ToString();
}

private MQUtility()   {}
}
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 » IBM MQ API Support » AMQMDNET Message issue
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.