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 » WebSphere Message Broker (ACE) Support » Issue with MQRFH2 <usr> tags

Post new topic  Reply to topic
 Issue with MQRFH2 <usr> tags « View previous topic :: View next topic » 
Author Message
newpie
PostPosted: Tue Sep 25, 2012 7:10 am    Post subject: Issue with MQRFH2 <usr> tags Reply with quote

Novice

Joined: 21 Jun 2012
Posts: 16

Hi,
While parsing the MQRFH header <usr> tags in message broker,I got the following error

error description : Size of folder invalid, less than zero or not a multiple of four

The issue was resolved after the <usr> tags string was adjusted such that whole stringsize is a multiple of 4.

I am just wondering whats the logic behind the usr string requirement to be a multiple of 4.
Also, given an MQ message, how do I verify if the MQRFH header is as expected. In the above case, how do I verify if the usr string is of expected size, which is a multiple of 4.

Any pointers or suggestions are grateful.

Please correct me if I had missed anything.

Regards,
Allen
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Sep 25, 2012 7:18 am    Post subject: Re: Issue with MQRFH2 <usr> tags Reply with quote

Grand High Poobah

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

newpie wrote:
I am just wondering whats the logic behind the usr string requirement to be a multiple of 4.


Back in the day, the usr (and other folders) had to be on a double word boundary. Younger readers are advised to Google this term.

newpie wrote:
Any pointers or suggestions are grateful.


Forget about it. The RFH2 entered it's twilight years with the introduction of message properties in WMQv7, and these should be used in preference to the RFH2. If you have a legacy application which still believes in the existence of an RFH2, get the queue manager to generate the RFH2 for you from the message properties.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
newpie
PostPosted: Tue Sep 25, 2012 7:27 am    Post subject: Reply with quote

Novice

Joined: 21 Jun 2012
Posts: 16

@Vitor.., Thanks for ur reply,..

It sounds like a standard, from "double word boundary"...but could not really understand why it has to be a multiple, will b great if you can explain the reasons or requierment for the size factor.....
Googling could not give the required info,, am sorry, if I have missed it..would be great if u can share the links u referred ....

Also, its a legacy system and we need to use the existing setup only( client requirement, or have-to follow the existing framework here !). In view of this it helps me better to know why and how about this usr folder size concept....

Thanks for ur time,..

Regards,
Allen
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Sep 25, 2012 7:38 am    Post subject: Reply with quote

Grand High Poobah

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

newpie wrote:
It sounds like a standard, from "double word boundary"...but could not really understand why it has to be a multiple, will b great if you can explain the reasons or requierment for the size factor.....


1 character = 1 byte (unless you're using DCBS and this term dates from before 16 bit Unicode). 2 bytes = a word, 4 bytes = a doubleword. It used to be more efficient for structures in memory to be aligned on these boundaries for arcane reasons not relevent in today's world. I'm talking about the good old days when a medium sized mainframe had about the same memory size & processing power as a modern smartphone.

newpie wrote:
Googling could not give the required info


So the knowledge is truely obsolete. Now I feel old.

newpie wrote:
Also, its a legacy system and we need to use the existing setup only( client requirement, or have-to follow the existing framework here !).


So ensure the queue manager is set up for compatibility, as I discussed above.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
newpie
PostPosted: Tue Sep 25, 2012 8:06 am    Post subject: Reply with quote

Novice

Joined: 21 Jun 2012
Posts: 16

@Vitor,...Thanks for the reply,..

Let me put down my understanding , from what u said...

The memory structures used to be defined in double-word boundaries,,to put it in other words..., as per those old standard,.. usr string needs to be a multiple of 4 or a set of double-words,...

Is this how Message broker is designed to read the usr folder,? and hence the standard,...


Also, my requirement is to parse the MQRFH.usr tags and the msgflow could read it only if the above condition is met,.. as I said we managed to get it by making the usr string size a multiple of 4,,...so we are able to parse it,..

the ques arised as I felt that , the concept of making the usr string a size of 4n sounded a blind- practice without knowing how & why,...

If we consider it as a product internal design and its good enuf to use it that way and not worth knowing it,,...hope this ques could not have arised

One more thing here,....Given an MQ message ,, Is there a way that I can check the usr folder size and validate manually,...
and conclude that usr folder is as expected or findout the deviations,...
basically ,.. any tool or approach to diagnose the RFH or usr standards issues,... This would of great help to know, as I frequent get these issues withe existing applications,...


Many Thnks for ur time .. !


Regards,
Allen
Back to top
View user's profile Send private message Send e-mail
kimbert
PostPosted: Tue Sep 25, 2012 8:21 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Is this how Message broker is designed to read the usr folder,? and hence the standard,...
Nope - nothing to do with WMB or WMQ. Word alignment has always been important for performance, and still is today. Every C/C++ compiler in the world needs to take it into account, as this month's Dr Dobbs shows:
http://www.drdobbs.com/cpp/padding-and-rearranging-structure-member/240007649

Incidentally, the MRM and DFDL parsers in message broker have explicit facilities for parsing word-aligned structures - it is required for parsing COBOL data.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 25, 2012 8:33 am    Post subject: Reply with quote

Grand High Poobah

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

newpie wrote:
The memory structures used to be defined in double-word boundaries,,to put it in other words..., as per those old standard,.. usr string needs to be a multiple of 4 or a set of double-words,...


It used to be practice to align such structures for performance & efficientcy.

newpie wrote:
Is this how Message broker is designed to read the usr folder,? and hence the standard,...


It's only a message broker standard in so far as it was an industry standard. AFAIK (which is perhaps not far enough) even modern C/C++/C## compilers use this kind of alignment. They just do it under the covers so you don't have to code for it any more.


newpie wrote:
Also, my requirement is to parse the MQRFH.usr tags and the msgflow could read it only if the above condition is met,.. as I said we managed to get it by making the usr string size a multiple of 4,,...so we are able to parse it,..


So you got it to work by making the RFH2 conform to the standard which is documented to this day in the v7 InfoCenter? Good move.

newpie wrote:
the ques arised as I felt that , the concept of making the usr string a size of 4n sounded a blind- practice without knowing how & why,...


No, it's a documented part of the RFH2 structure.

newpie wrote:
One more thing here,....Given an MQ message ,, Is there a way that I can check the usr folder size and validate manually,...
and conclude that usr folder is as expected or findout the deviations,...
basically ,.. any tool or approach to diagnose the RFH or usr standards issues,...


- Write yourself some code
- Follow my suggestion to get the queue manager to do this for you
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 25, 2012 8:34 am    Post subject: Reply with quote

Grand High Poobah

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

kimbert wrote:
Quote:
Is this how Message broker is designed to read the usr folder,? and hence the standard,...
Nope - nothing to do with WMB or WMQ. Word alignment has always been important for performance, and still is today. Every C/C++ compiler in the world needs to take it into account, as this month's Dr Dobbs shows:
http://www.drdobbs.com/cpp/padding-and-rearranging-structure-member/240007649

Incidentally, the MRM and DFDL parsers in message broker have explicit facilities for parsing word-aligned structures - it is required for parsing COBOL data.


I feel so much less now. Thank you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
newpie
PostPosted: Tue Sep 25, 2012 8:41 am    Post subject: Reply with quote

Novice

Joined: 21 Jun 2012
Posts: 16

kimbert wrote:
Quote:
Is this how Message broker is designed to read the usr folder,? and hence the standard,...
Nope - nothing to do with WMB or WMQ. Word alignment has always been important for performance, and still is today. Every C/C++ compiler in the world needs to take it into account, as this month's Dr Dobbs shows:
http://www.drdobbs.com/cpp/padding-and-rearranging-structure-member/240007649

Incidentally, the MRM and DFDL parsers in message broker have explicit facilities for parsing word-aligned structures - it is required for parsing COBOL data.



@Kimbert,...noted, Thanks for the info, it was an eye-opener,...!
Back to top
View user's profile Send private message Send e-mail
newpie
PostPosted: Tue Sep 25, 2012 9:06 am    Post subject: Reply with quote

Novice

Joined: 21 Jun 2012
Posts: 16

Vitor wrote:
newpie wrote:
The memory structures used to be defined in double-word boundaries,,to put it in other words..., as per those old standard,.. usr string needs to be a multiple of 4 or a set of double-words,...


It used to be practice to align such structures for performance & efficientcy.


Noted, thanks for the info,.,...

Vitor wrote:

newpie wrote:
the ques arised as I felt that , the concept of making the usr string a size of 4n sounded a blind- practice without knowing how & why,...


No, it's a documented part of the RFH2 structure.


Noted, did you mean its a documented standard to be followed and not to be considered as not-justified or explained reason?..
ok, I wud take it as product standard documented to be followed,.. thanks...


Vitor wrote:

newpie wrote:
One more thing here,....Given an MQ message ,, Is there a way that I can check the usr folder size and validate manually,...
and conclude that usr folder is as expected or findout the deviations,...
basically ,.. any tool or approach to diagnose the RFH or usr standards issues,...



- Write yourself some code
- Follow my suggestion to get the queue manager to do this for you



Thanks for the suggestion, So, far I could resolve the issue managing the sizing standard of the usr, in the request message from the source application, in the jave code they used,..
but once the message is in my middleware server,..how to check or validate the header is a ques,...
any logic based on which u advised me to code , to check the size?
...and if there is no tool to check this, I'm surprised,...


My sincere thanks for ur replies, and ur time.Definitely this is a good learning and provided some insights into the product design...and the compiler standards !

Regards,
Allen
allen4u12@gmail.com
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Sep 25, 2012 9:57 am    Post subject: Reply with quote

Grand High Poobah

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

newpie wrote:
Noted, did you mean its a documented standard to be followed and not to be considered as not-justified or explained reason?..
ok, I wud take it as product standard documented to be followed,.. thanks...


If you look in the InfoCenter, it's documented that the RFH2 folders need to be aligned like this. In the same way it talks about the order in which some function calls take parameters. You can't ignore the parameter order if you expect the call to work and likewise you can't ignore how data structures need to be built.


newpie wrote:
Thanks for the suggestion, So, far I could resolve the issue managing the sizing standard of the usr, in the request message from the source application, in the jave code they used,..
but once the message is in my middleware server,..how to check or validate the header is a ques,...


Why? If the application is sending badly formed RFH2 headers it's their problem not yours. Also having detected such an ill-formed header, what can you do about it?

I also repeat that if you're developing any new code your application should use message properties and use the queue manager to convert them into an RFH2 for the benefit of any legacy application.

newpie wrote:
any logic based on which u advised me to code , to check the size?


You could walk the code. I repeat my comments above about the value of this.

newpie wrote:
...and if there is no tool to check this, I'm surprised,...


Surprise. It's not a tool that's needed.

P.S. Don't have your email in your signature unless you enjoy a lot of spam. The web spiders will claim it.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Issue with MQRFH2 <usr> tags
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.