Search code examples
c#ibm-mqmq

Read And Write To Header Message MQ C#


I am reading an MQMessage in like so

       queue.Get(message, gmo);

        string message1 = message.ReadString(message.MessageLength);

I can see there is a message.UserId on MQMessage, but that is not enough

I want the users to get additional information in the message header of an MQMessage.

How can I set and then retrieve the following from a header of an MQMessage

username 
password
mySpecialID

Solution

  • This can be done like this

    msg.SetStringProperty("NicksProp", "blahblah");