Well, it’s been a while and development on my project has been going on. We’ve just started to test the actual use of this field to set the Group ID, and it is failing. The Group ID of messages posted is always a string of 24 null (0x00) bytes, regardless of the setting of …/msgHeader/GroupIdByteArray.
While testing posting a message to the queue outside of webMethods, I produced the sample code I include below. The end result of this code mimics the current behavior I am seeing in webMethods, if you omit the MQMF_MSG_IN_GROUP flag before posting the message to the queue. Including the MQMF_MSG_IN_GROUP flag correctly includes the Group ID with the message.
How do you tell webMethods to use the GroupIdByteArray and/or use the MQMF_MSG_IN_GROUP flag when posting messages to the queue?
– BEGIN C# CODE FRAGMENT –
byte[] aPayload = System.Text.Encoding.ASCII.GetBytes( "Queue Message Payload" );
byte[] aGroupID = System.Text.Encoding.ASCII.GetBytes( "THISISASAMP24BYTEGROUPID" );
IBM.WMQ.MQQueueManager qm = new IBM.WMQ.MQQueueManager(
"QUEUEMANAGER", // replace with development queue manager name
"SERVERCHANNEL", // replace with development channel name
"SERVER(PORT)"); // replace with development server name and port
IBM.WMQ.MQQueue q = qm.AccessQueue(
"QUEUE", // replace with development queue name
IBM.WMQ.MQC.MQOO_OUTPUT );
IBM.WMQ.MQMessage m = new IBM.WMQ.MQMessage();
m.Write( aPayload, 0, aPayload.Length );
m.GroupId = aGroupID;
m.MessageFlags |= IBM.WMQ.MQC.MQMF_MSG_IN_GROUP; // MUST SPECIFIFY THIS FLAG
q.Put( m );
q.Close();
qm.Close();
– END C# CODE FRAGMENT –
#webMethods#Adapters-and-E-Standards#Integration-Server-and-ESB