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 » General IBM MQ Support » MQRFH2 and variable length segments

Post new topic  Reply to topic
 MQRFH2 and variable length segments « View previous topic :: View next topic » 
Author Message
international
PostPosted: Wed Jun 27, 2012 6:47 am    Post subject: MQRFH2 and variable length segments Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 37

Hello.
It used to be that the variable length segments had to be multiples of 4. This still appears to be the case (get 2421 if you try a length that isn't a multiple of 4, and v7 generated RFH2s all have multiples of 4).
However, I can't find anything in the IBM v7 docs/info centre that explicitly says this is the case. Does anyone know if there is such a statement anywhere?

cheers
Tony

P.S. Why do I need an explicit statement? Politics
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 27, 2012 6:58 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Well, here's the thing.

You shouldn't use an MQRFH2 with v7. You should use message properties...
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 27, 2012 7:00 am    Post subject: Re: MQRFH2 and variable length segments Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

international wrote:
However, I can't find anything in the IBM v7 docs/info centre that explicitly says this is the case.


Interestingly I looked in the description of the MQRFH2 in the Application Programming Reference and found:

Quote:
NameValueData is a variable length field that contains a folder containing name/value pairs or message properties. A folder is a variable-length character string containing data encoded using an XML-like syntax. The length in bytes of the character string is given by the NameValueLength field that precedes the NameValueData field. The length must be a multiple of four.


Note that in v7 you should be thinking more about message properties than an RFH2 anyway.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
international
PostPosted: Wed Jun 27, 2012 7:09 am    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 37

Thanks for the link!

There are still applications out there built pre v7 which construct their own RFH2s. MQ v6 allowed messages to be written with any old variable length (i.e. no check on a multiple of 4 was done). MQ v7 does check. So a rewrite of the applications is required, hence the politics and hence the need for an explicit statement from IBM

Also, it's all very well saying "don't use RFH2 with v7", but v7 requires the variable segments to be two dimensional (e.g. usr can have children, but those children can't have children). Pre v7 there was no such limitation so there are applications out there which have relatively complex XML documents under the usr folder. These folders cann't be parsed successfully by MQ v7 unless the MQGMO_PROPERTIES_FORCE_MQRFH2 is used. Similarly, the RFH2 folders can't be populated (with complex XML documents) using properties.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 27, 2012 7:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you're having issues migrating apps that use v6 client to connect to v7 queue managers, you should really just migrate the apps to use v7 clients anyway.

I.e. instead of making changes to the apps to cause them to support the additional validation of the MQRFh2 on v7 queue manager, you should make changes to them to use properties instead?

I'm not sure I understand the choices being made.
Back to top
View user's profile Send private message
international
PostPosted: Wed Jun 27, 2012 7:29 am    Post subject: Reply with quote

Apprentice

Joined: 19 Jun 2006
Posts: 37

Politics Whatever costs least. And the least cost is just changing the variable segment length.

As for the applications that have complex contents of the usr folder - thats a significant rewrite. Easy for IBM to change the functionality, not necessarily so easy for MQ applications to rewrite/test/regressiion test etc...
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 27, 2012 8:37 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

I don't recall an IBM statement regarding the death of MQRFH2. V7 offers a "better" programming interface to message properties; but only for applications that make use of the new API calls related to message properties.
_________________
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
View user's profile Send private message
Vitor
PostPosted: Wed Jun 27, 2012 8:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bruce2359 wrote:
I don't recall an IBM statement regarding the death of MQRFH2. V7 offers a "better" programming interface to message properties; but only for applications that make use of the new API calls related to message properties.


As previous discussed in this forum, RFH2 is not dead but has entered it's golden years. We should all look forward to the day, some time hence, when it finally drops off the twig. There's certainly no need to rush out and instantly convert every application to use message properties but as part of the normal development cycle we should be thinking about making the changes while we have the application going through a testing cycle.

So as the OP will have to alter the code anyway, it's valid to raise the point. Despite the protestations on cost it's still cheaper to test now than test now once the length is fixed and test again when the RFH2 finally goes.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 27, 2012 8:57 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

I bellieve the OP is pondering whether rewriting MQRFH2 apps is mandatory now or in the forseeable future. It is not.
_________________
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
View user's profile Send private message
Vitor
PostPosted: Wed Jun 27, 2012 9:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bruce2359 wrote:
I bellieve the OP is pondering whether rewriting MQRFH2 apps is mandatory now or in the forseeable future. It is not.


It is, at least in this circumstance. The RFH2 apps in question do not correctly position data on the 4 byte boundary and hence don't work under v7. Hence they need a minor rewrite to introduce this functionality because the product has changed (to make this check) and there's nothing to be done at a configuration level to reverse it. Hence:

international wrote:
Easy for IBM to change the functionality, not necessarily so easy for MQ applications to rewrite/test/regressiion test etc...


Despite the minor nature of this activity, the apps will still need to make their way through the testing cycle before they can go to production, which as the OP says in the quote is not so easy. Given that assembling the resources and political will for this is now inevitable, there's a case to say to this penny pinching management "look, we're going to have to do all this again in the future when the RFH2 goes. Why not change the apps now and do it all in a single test cycle?".

It's highly likely the response will be one of:

"We don't have time"
"There's no money in the budget"
"Why bother? It's not like I'll still be here when it happens. Let the poor fool who's manager then worry about it; I'll be too busy furnishing my corner office by then"

but at least when the hammer falls you can say you raised the issue.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 27, 2012 2:57 pm    Post subject: Reply with quote

Grand High Poobah

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

international wrote:
Thanks for the link!

There are still applications out there built pre v7 which construct their own RFH2s. MQ v6 allowed messages to be written with any old variable length (i.e. no check on a multiple of 4 was done). MQ v7 does check. So a rewrite of the applications is required, hence the politics and hence the need for an explicit statement from IBM

Also, it's all very well saying "don't use RFH2 with v7", but v7 requires the variable segments to be two dimensional (e.g. usr can have children, but those children can't have children). Pre v7 there was no such limitation so there are applications out there which have relatively complex XML documents under the usr folder. These folders cann't be parsed successfully by MQ v7 unless the MQGMO_PROPERTIES_FORCE_MQRFH2 is used. Similarly, the RFH2 folders can't be populated (with complex XML documents) using properties.


Don't quite follow your part about two dimensional properties. You mean you can't set an XML to a text property? I beg to differ... Your xml may be escaped if looking at the hard data, but as soon as you retrieve the property, you should see it unchanged... It may require a little bit more manipulation, but you'd be conforming to IBM guidelines...
Haven't tried an object property with nested objects in it either...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » MQRFH2 and variable length segments
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.