Author |
Message
|
pcelari |
Posted: Thu Mar 22, 2012 9:56 am Post subject: unable to read message with MQMD.Format as MQHRF2 |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Hello,
I have a C program that read messages from a log queue and write them to a file. Recently the application sending the messages got changed to a JMS-based. Since then my program keeps displaying MQRC 2110 MQRC_FORMAT_ERROR, and in the file, instead of the message content, it write only a 'RFH'
A closer look to the messages shows the MQMD.Format field is now MQHRF2 instead of the old MQSTR.
My program was written just a few years ago, long after MQHRF2 was introduced. Why is it unable to read messages containing a MQHRF2 in the chain of headers?
What should I look to change in the program?
Thanks for sharing your insight.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 10:06 am Post subject: Re: unable to read message with MQMD.Format as MQHRF2 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
pcelari wrote: |
My program was written just a few years ago, long after MQHRF2 was introduced. Why is it unable to read messages containing a MQHRF2 in the chain of headers? |
Because there's no code on your C program to handle the RFH2. A pure C application can't use XMS to deal with such messages.
pcelari wrote: |
What should I look to change in the program? |
You could recode your application.
IMHO a better solution is to ask the sending application which recently changed to JMS (and hence made you the proud receipient of an RFH2) to suppress the RFH2 when they send it. They need to code TARGCLIENT=1 (or some such value) on something Java-ish (JNDI??) to indicate that the message is being consumed by a non-JMS application (i.e. your C code) & doesn't want a JMS header (expressed in WMQ as an RFH2).
The Search Facility Is Your Friend. It's been discussed in here before somewhere but the coffee machine wasn't cleaned last night & I'm too busy being miserable to look for it.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 22, 2012 10:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The Format field on the MQMD indicates the format of the next part of the message. So, in your case, the Format field indicates that the message includes an MQRFH2 header.
The MQRFH2 header will have a Format field, that will indicate the format of the *next* part of the message. So there's no indication that the error has anything to do with the MQRFH2. It could be that the rest of the message is now a jms/bytes message holding a serialized java object, instead of the MQFTM_STRING data you had previoulsy been receiving.
Regardless, change the queue manager and associated queues to set the PROPCTL to force the messages to be sent with Message Properties instead of an MQRFH2. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 10:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Regardless, change the queue manager and associated queues to set the PROPCTL to force the messages to be sent with Message Properties instead of an MQRFH2. |
Objection your honour! Assumes the use of WMQv7 not in evidence!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 10:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
The MQRFH2 header will have a Format field, that will indicate the format of the *next* part of the message. So there's no indication that the error has anything to do with the MQRFH2. It could be that the rest of the message is now a jms/bytes message holding a serialized java object, instead of the MQFTM_STRING data you had previoulsy been receiving. |
This is of course quite true. If the sending application has moved from using native WMQ to JMS and is now sending a serialized Java object rather than a string then you really need to recode your application. Once you've explained to whoever did their impact analysis what a bad job they did. Repeatedly and quite hard.
mqjeff wrote: |
Regardless, change the queue manager and associated queues to set the PROPCTL to force the messages to be sent with Message Properties instead of an MQRFH2. |
If you are using WMQv7, then this is the thing to do. The RFH2 is dead; long live the message properties. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 22, 2012 10:41 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
mqjeff wrote: |
Regardless, change the queue manager and associated queues to set the PROPCTL to force the messages to be sent with Message Properties instead of an MQRFH2. |
Objection your honour! Assumes the use of WMQv7 not in evidence!  |
You put a 'u' in that word where it does not belong.
It does assume a use of MQ v7, which is not strictly demonstrated. However, given.... http://www-01.ibm.com/support/docview.wss?uid=swg21584325
NOBODY SHOULD STILL BE ON V6. You have about six months to migrate. you should already be done. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 11:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
NOBODY SHOULD STILL BE ON V6. |
Hands up everybody still on v5. Now duck!
I put it to you that aside from the maniacs still on v5, there are a significant number of v6 sites that either have no upgrade plan, or an upgrade plan with a planned completion date more than 6 months in the future.
I'm not saying that's right, or that it's smart, or that it's safe. I'm just saying that's how it is. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Mar 22, 2012 11:56 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Vitor wrote: |
I'm not saying that's right, or that it's smart, or that it's safe. I'm just saying that's how it is. |
Yes, I know. That does not affect my decision to assume that posters are on supported versions until explicitly mentioned otherwise. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 22, 2012 11:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
Vitor wrote: |
I'm not saying that's right, or that it's smart, or that it's safe. I'm just saying that's how it is. |
Yes, I know. That does not affect my decision to assume that posters are on supported versions until explicitly mentioned otherwise. |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mvic |
Posted: Thu Mar 22, 2012 2:05 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
mqjeff wrote: |
Yes, I know. That does not affect my decision to assume that posters are on supported versions until explicitly mentioned otherwise. |
It is possible (common?) to purchase extended support for versions that are otherwise considered "out of support". Possibly V6 will be with us longer than you think  |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Mar 22, 2012 2:42 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
All things are possible. But you will not like the hourly or daily rate for such a support engagement. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
pcelari |
Posted: Fri Mar 23, 2012 10:23 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
mqjeff wrote: |
The Format field on the MQMD indicates the format of the next part of the message. So, in your case, the Format field indicates that the message includes an MQRFH2 header.
|
The mentioned PROPCTL seems too complicated for me now. So I decide to alter the message with a simple wmb msgflow that explicitly set the
MQMD.Format = MQFMT_STRING, nullifies the MQRFH2 header, and copy InputBody into lastchild of InputRoot.
It seems I have to read the new application development guide and rewrite my pround program that has been running for years without any issue.
thanks a lot!
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Mar 24, 2012 1:14 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
pcelari wrote: |
mqjeff wrote: |
The Format field on the MQMD indicates the format of the next part of the message. So, in your case, the Format field indicates that the message includes an MQRFH2 header.
|
The mentioned PROPCTL seems too complicated for me now. So I decide to alter the message with a simple wmb msgflow that explicitly set the
MQMD.Format = MQFMT_STRING, nullifies the MQRFH2 header, and copy InputBody into lastchild of InputRoot.
It seems I have to read the new application development guide and rewrite my pround program that has been running for years without any issue.
thanks a lot!
 |
As long as you going into a development cycle, consider using either JMS or XMS. No more nightmares about RFH headers. It's all handled for you behind the scenes now.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|