Ben
Ben

Reputation: 2715

MQ messages coming through as MQRFH2 instead of MQSTR

We have a ASP.NET web service that receives text and destination information and sends MQ messages from our server to another windows server using IBM WebSphere MQ Client.

We had v6 installed and everything was working fine sending messages to a server with v9.0.0.1 installed. We have upgraded our server from v6 to v9.

Messages are now being received as header type MQHRF2 when these messages are being explicitly sent as MQSTR header type.

This is likely something to do with the upgrade from v6->v9. Any ideas on what could be causing this would be very helpful as I'm at a loss.

EDIT: Code Sample:

This is a condensed version of how we are interacting with the MQ API in our web application:

MQEnvironment.Hostname = "TEST_HOST";
MQEnvironment.Channel = "TEST_CHANNEL";
MQEnvironment.Port = 1414; // Default MQ Port
var queueMgr = new MQQueueManager("TEST", new Hashtable());

var openOptions = MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_OUTPUT + MQC.MQOO_SET_ALL_CONTEXT;
var queue = queueMgr.AccessQueue("QueueName", openOptions);

var message = new MQMessage();
message.ApplicationIdData = ".xml";
message.Write(Encoding.UTF8.GetBytes("test"));
message.Format = MQC.MQFMT_STRING;
message.Persistence = MQC.MQPER_PERSISTENT;
message.CorrelationId = MQC.MQCI_NEW_SESSION;

var putOptions = new MQPutMessageOptions();
putOptions.Options += MQC.MQPMO_SET_IDENTITY_CONTEXT + MQC.MQPMO_SYNCPOINT;

queue.Put(message, putOptions);
queueMgr.Commit();

Upvotes: 1

Views: 3156

Answers (1)

Ben
Ben

Reputation: 2715

The issue here is that we have a third party tool, AppDynamics installed and running on this server. This tool is used for performance management. This tool interferes with MQ messages causing the behaviour I have details; messages being received as MQHRF2 format.

This is noted in IBM's documentation: https://www.ibm.com/support/knowledgecenter/en/SSYHZ9_5.5.0/com.ibm.omegamon_apm.doc/troubleshooting/zapm_issues.htm

  • AppDynamics dynamically adds an MQ message property to messages to be tracked, which is transmitted in the message via an MQRFH2 header. Before you configure AppDynamics, ensure that your application programs are not affected by this modification to messages. Examples of applications that might be affected are ones that expect message content at a specific location in the message without bypassing possible extra headers in the message.

This issue can be exposed by toggling on & off the AppDynamics service on the server. With the service stopped, all messages are received in the MQSTR when send as MQSTR.

AppDynamics was already installed and running when the server had MQ Client v6 installed. This issue only started to arise when upgrading to MQ Client v9.

Upvotes: 2

Related Questions