ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Java API: MQRC 2421 writing RFH2 on certain platforms

Post new topic  Reply to topic Goto page 1, 2  Next
 Java API: MQRC 2421 writing RFH2 on certain platforms « View previous topic :: View next topic » 
Author Message
notoneword
PostPosted: Wed Jun 22, 2011 10:43 am    Post subject: Java API: MQRC 2421 writing RFH2 on certain platforms Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

I'm getting MQRC 2421 errors (MQRC_RFH_FORMAT_ERROR) when putting messages with RFH2 headers on certain platforms. It works fine on Windows MQ6 and z/OS MQ7. It's failing on MQ7 Windows & Linux. Here's the code:

Code:
       MQHeaderList list = new MQHeaderList();
      MQRFH2 rfh = new MQRFH2();
      ...
      while (nameValIter.hasNext()) {
         rfh.setNameValueData(nameValIter.next());
      }
      rfh.setFormat(MQConstants.MQFMT_STRING);
      ..
      list.add(rfh);
      msg.format = MQConstants.MQFMT_RF_HEADER_2;
      list.write(msg);



Here's the MQRFH2 structures, identical whether failing or not.

Quote:

MQ7 Linux (fails)

MQRFH2 (com.ibm.mq.headers.internal.store.ByteStore [encoding: 0x00000001, ccsid: 1208, size: 60] @9303440)
MQCHAR4 StrucId: "RFH "
MQLONG Version: 2 (0x00000002)
MQLONG StrucLength: 60 (0x0000003c)
MQLONG Encoding: 273 (0x00000111)
MQLONG CodedCharSetId: 437 (0x000001b5)
MQCHAR8 Format: "MQSTR "
MQLONG Flags: 0 (0x00000000)
MQLONG NameValueCCSID: 1208 (0x000004b8)
MQBYTE[] NameValueData: 0x00000014424d4d41444d494e3a524648322d4d5347202020


MQ6 windows (succeeds)

MQRFH2 (com.ibm.mq.headers.internal.store.ByteStore [encoding: 0x00000001, ccsid: 1208, size: 60] @30620998)
MQCHAR4 StrucId: "RFH "
MQLONG Version: 2 (0x00000002)
MQLONG StrucLength: 60 (0x0000003c)
MQLONG Encoding: 273 (0x00000111)
MQLONG CodedCharSetId: 437 (0x000001b5)
MQCHAR8 Format: "MQSTR "
MQLONG Flags: 0 (0x00000000)
MQLONG NameValueCCSID: 1208 (0x000004b8)
MQBYTE[] NameValueData: 0x00000014424d4d41444d494e3a524648322d4d5347202020


I'd appreciate any replies to speak to how to do this with the Java MQ API, I've been told to leave JMS out of it.

Seems to me like there's a difference between MQ6 and MQ7, and in MQ7 there's a difference in platforms, possibly a byte-order/encoding issue? I don't know, looking for any ideas, suggestions on things to try.

thanks,
Tom
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 22, 2011 10:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

I you want to use an RFH2 you should use JMS which will do it seemlessly for you. Non Java programs can use XMS for the same purpose.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mvic
PostPosted: Wed Jun 22, 2011 10:54 am    Post subject: Re: Java API: MQRC 2421 writing RFH2 on certain platforms Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

notoneword wrote:
Seems to me like there's a difference between MQ6 and MQ7, and in MQ7 there's a difference in platforms, possibly a byte-order/encoding issue? I don't know, looking for any ideas, suggestions on things to try.

Put on the very latest fix pack on client and server then re-test, to make sure it's not an already-fixed issue. After that, if you see an incompatibility between v6 and v7, open a PMR and get IBM to look at it for you.
Back to top
View user's profile Send private message
notoneword
PostPosted: Wed Jun 22, 2011 10:56 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

Thanks for the reply.

I"m trying to do this w/o the JMS classes. MQHeaderList allows you to add headers, it should work. It does work on many of the platforms. I'm currently being directed *not* to use the JMS classes for this so if anyone has any advice on using MQHeaderList, and what may account for the different results I'm seeing, I'd appreciate it.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 22, 2011 10:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I would use MQ v7 Message Properties instead of an RFH header.

These should get mapped to RFH headers when moving to a v6 qmgr or when connecting to a v6 qmgr (to the best of my knowledge).
Back to top
View user's profile Send private message
notoneword
PostPosted: Wed Jun 22, 2011 10:58 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

Thanks mvic, yeh, it's starting to look like PMR time....
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Jun 22, 2011 11:00 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

notoneword wrote:
if anyone has any advice on using MQHeaderList, and what may account for the different results I'm seeing, I'd appreciate it.

It could be a bug. Try the latest fix pack.

You don't need to use JMS for properties at V7. Look at the set*Property and get*Property methods on com.ibm.mq.MQMessage.

Documentation: http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.javadoc.doc/WMQJavaClasses/com/ibm/mq/MQMessage.html
Back to top
View user's profile Send private message
notoneword
PostPosted: Wed Jun 22, 2011 11:24 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

Thanks everyone for the replies and ideas!
Back to top
View user's profile Send private message
notoneword
PostPosted: Fri Jun 24, 2011 11:02 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

Opened PMR, and it turns out that MQ7 is much stricter about name-value properties than MQ6.

My problem in testing was that I was passing in just plain strings, no folder names defined. Once I added <mcd>... </mcd> around the string, the 2421 error was gone.

... so hopefully my stupidity will serve as an example/warning for others!
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Jun 24, 2011 3:09 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

notoneword wrote:
Once I added <mcd>... </mcd> around the string, the 2421 error was gone.

If you are able to alter your code to "make it work" then maybe that's fine.

But I couldn't see what you had done wrong in your application source code. It also doesn't sound right that the same program would work on one version or server, yet not on another.

What did you change in your source (can you give us another snippet?) to make it work?
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Jun 24, 2011 3:13 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

notoneword wrote:
Opened PMR, and it turns out that MQ7 is much stricter about name-value properties than MQ6.

What fix pack of MQ V7 was it?

BTW I didn't understand "much stricter". What is the difference - does MQ v7 handle the MQRFH2 object in your Java program differently?
Back to top
View user's profile Send private message
notoneword
PostPosted: Fri Jun 24, 2011 3:31 pm    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

I had applied fixpack 7.0.1.5 as IBM suggested.

Here's a quote from the email that may give some more context about the 'strictness' of RFH handling in MQ7:

Quote:
"MQ V7 supports message properties and in order to implementthis
support some parsing of the MQRFH2 header is performed.This requires
MQ V7 to be more aware of the MQRFH2 content, andmore stringent
validation of the MQRFH2 is performed."


.. and nothing in my code really had to change, it was my test data I had to change. I had been - rather cluelessly I admit - just passing in a string like 'RFH:DATA' w/o any folders specified. The error went away when I passed in '<mcd>RFH:DATA</mcd>' instead.

Hope this helps answer your questions...
Back to top
View user's profile Send private message
notoneword
PostPosted: Fri Jun 24, 2011 3:42 pm    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

... also, I've noticed issues, even with my changes that work, if I set the Encoding of the message to 546, I'll get 2421 errors again. I *think* that it's related to this issue - http://www-01.ibm.com/support/docview.wss?uid=swg1IZ86625 (scheduled to be fixed in 7.0.1.6) - though that is purely speculation on my part.
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Jun 24, 2011 4:24 pm    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

I don't know why you would want to change the Encoding, in a Java program. The Encoding declares how fields holding numbers are byte-ordered, etc. Do you actually need to alter the value to 546 ? Interested to know why, if so.
Back to top
View user's profile Send private message
notoneword
PostPosted: Sat Jun 25, 2011 9:44 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2011
Posts: 37

Well, it's a general purpose message editor, in which the user can edit MQMD fields, Encoding being one of them. Are you saying that the byte-order of java would affect whether MQ could write the fields in different encoding values? I'm curious now whether I should even be trying that...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Java API: MQRC 2421 writing RFH2 on certain platforms
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.