nitgeek
nitgeek

Reputation: 1258

MQRFH2.usr coming in the main message body

Using WMQ7.0 with WMB 6.1

I have one flow where I am transforming a message and using MQRFH2.usr for holding some data.

But, I am facing the issue where the MQRFH2.usr is coming in the main message body.

I have deployed the same code in different environments, but I am getting this issue only in one environment.

So, it doesn't seems to be a code issue. It has something to do with configurations.

Kindly, suggest what could be the possible cause.

Upvotes: 1

Views: 2644

Answers (2)

Martins
Martins

Reputation: 1261

The MQRFH2 headers, if present, always come in the payload part of the message (that's the way webpshere organizes it). You can receive one or more MQRFH2 headers (structures).

Perhaps you are expecting only one and are receiving two? This would explain your message data being left with gibberish.

I use the following code to handler these heards upon receiving a message

MQRFH2 header = null;

// Find and store message length
int msglen = replyMessage.getMessageLength();

MQHeaderList list = new MQHeaderList(replyMessage);
int indexOf = list.indexOf("MQRFH2");
if (indexOf >= 0) {
    header = (MQRFH2) list.get(indexOf);
    msglen = msglen - header.size();
}

String msgText = replyMessage.readStringOfCharLength(msglen);

Hope it helps.

Martins

Upvotes: 0

T.Rob
T.Rob

Reputation: 31832

Check the queue's PROPCTL setting. If this is set to NONE then the behavior is as follows:

If the application does not create a message handle, all the message properties are removed from the MQRFH2. Name/value pairs in the MQRFH2 headers are left in the message.

Be sure to read the doc page through a couple of times and maybe test with different settings to understand fully how PROPCTL modifies the message content your app receives.

Upvotes: 1

Related Questions