Author |
Message
|
kash3338 |
Posted: Mon Feb 07, 2011 8:10 pm Post subject: MQMD and MQRFH2 Headers |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Hi,
I have a scenario wherein i need to get the value of a Application through my Header as this cannot be sent as part of the Data (XML). Which is he better way to get this detail? Can i use MQMD header or the MQRFH2 header for this?
As per my understanding we are not supposed to use MQMD headers for storing data, but why is it so? I just need to get only this application name as part of my header? So can i store that in my MQMD header? |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 07, 2011 10:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can try and use the application Id field. However my guess is that this might get overwritten and just say broker... Otherwise use a property in the RFH2 header (usr folder)
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Herbert |
Posted: Tue Feb 08, 2011 12:21 am Post subject: |
|
|
 Centurion
Joined: 05 Dec 2006 Posts: 146 Location: Leersum, The Netherlands
|
fjb_saper wrote: |
You can try and use the application Id field. However my guess is that this might get overwritten and just say broker... |
Default it is indeed overwritten, however if you use the option "Set Idenity" with the "Message Context" property of the MQOuput node you can set your own values in ESQL for some MQMD fields, I think application Id is one of them.
hgj |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Feb 08, 2011 1:05 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Can we use the MessageID field? Actually it has to be set by athird party application in the MQMD header and they are not able to send the detail in the MQRFH2 header.
Hence we dont have any other option other than MQMD to set this application name. Also th CorrelID has some other value already and hence cannot be used for thi purpose.
Is there any other field in MQMD (other than CorrelID and AppID) which can be used to get the application name? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Feb 08, 2011 2:07 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Don't try to use the CORRELID. This is a BLOB not a character field. Just search this forum for the tales of heartache from people trying to us MQMD fields incorrectly.
The ApplID is a good choice but... You really have to know some almost bit twiddling WMQ Application Programming to handle it correctly. Not many people (apart from us 'old timers') really understand WMQ app dev these days. Tools Like Broker make it very easy...
The MQRFH2 'usr' folder is ideal for this purpose.
That would be my choice.
also, the ApplId field is FIXED Length. All the fields in the MQMD are setup this way. It is a fixed 376 bytes (if I remember corrrectly) header. The RFH2 header 'usr' folder can have variable length character fields. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fatherjack |
Posted: Tue Feb 08, 2011 2:52 am Post subject: |
|
|
 Knight
Joined: 14 Apr 2010 Posts: 522 Location: Craggy Island
|
smdavies99 wrote: |
Don't try to use the CORRELID. This is a BLOB not a character field. Just search this forum for the tales of heartache from people trying to us MQMD fields incorrectly.
The ApplID is a good choice |
Thats what its there for. As the doc says:
Quote: |
ApplIdentityData is information that is defined by the application suite, and can be used to provide additional information about the message or its originator. |
_________________ Never let the facts get in the way of a good theory. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Feb 08, 2011 10:17 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
As i mentioned earlier, the AppID and the CorrelID are already holding some other information about the message and that cannot be used now.
Also, the third party application is not able to send the detail through MQRFH2 header. Hence we ought to get the message either in the UserID field or the MessageId field. We have now decided to get the information in the UserID field of MQMD. Is there any major problem in doing so? |
|
Back to top |
|
 |
smdavies99 |
Posted: Tue Feb 08, 2011 10:34 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Have you tried it? end-to-End?
Does it get overwritten anywhere? (Not copying the MQMD in a flow)
Do some experimantation. This is relatively obscure and I'd expect that to give you an answer someone would have to try it themselves. You could do that yourself _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fatherjack |
Posted: Wed Feb 09, 2011 1:41 am Post subject: |
|
|
 Knight
Joined: 14 Apr 2010 Posts: 522 Location: Craggy Island
|
kash3338 wrote: |
As i mentioned earlier, the AppID and the CorrelID are already holding some other information about the message and that cannot be used now. |
Actually you didn't. Otherwise I would not have suggested it. What you said was
Quote: |
Also th CorrelID has some other value already and hence cannot be used for thi purpose. |
_________________ Never let the facts get in the way of a good theory. |
|
Back to top |
|
 |
vmcgloin |
Posted: Wed Feb 09, 2011 6:08 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
I certainly would not like to support this. The applId & CorrelId are already being used - for what? What if you require the userId for its intended purpose?
You really need to push back on the fact that the 3rd party app cannot use message properties or RFH2 since they appear to be willing to make changes to hack the MQMD for your use, and it would almost certainly be easier to use and support an more appropriate header. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 09, 2011 6:13 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kash3338 wrote: |
We have now decided to get the information in the UserID field of MQMD. Is there any major problem in doing so? |
If you decide to implement any kind of security solution in the future non-user information in the UserId field is not going to make your life any easier. If the amount of information you need to carry increases past the size of the user id field you're done.
You seem (if I have it right) to have application data in the ApplId, the CorrelId (and that's the biggest potential problem) and now the user id field. Why keep trying to squeeze data into the MQMD? Put an RFH2 on the message, move all the business data into that and eliminate both the problems of dual field use and restricted size at a stroke. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kash3338 |
Posted: Thu Feb 10, 2011 9:13 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Vitor wrote: |
Why keep trying to squeeze data into the MQMD? Put an RFH2 on the message, move all the business data into that and eliminate both the problems of dual field use and restricted size at a stroke. |
The problem is that, from the application side they are not able to set the values in the MQRFH2 headers and thats the only reason we have put them in the MQMD headers.
Is there any other better solution than these two headers? (MQMD and MQRFH2). Database and MQ option is ruled out. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 10, 2011 9:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If they can't set an MQRFH2, can they set Message Properties? |
|
Back to top |
|
 |
wmb_wps_soa |
Posted: Thu Feb 10, 2011 1:09 pm Post subject: |
|
|
Acolyte
Joined: 19 Feb 2010 Posts: 65 Location: Detroit,Michigan,USA.
|
Is it good practice to carry the application name (or application details) under Message.Properties? |
|
Back to top |
|
 |
Vitor |
Posted: Thu Feb 10, 2011 1:15 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
wmb_wps_soa wrote: |
Is it good practice to carry the application name (or application details) under Message.Properties? |
The application name is usually carried in the ApplicationId field of the MQMD (as discussed above).
If there's business or other details that describe the message and/or it's payload then message properties or an RFH2 is a good place to carry is (also as discussed above).
(And before anyone says that message properties are synonymous with the MQMD & MQRFH2 then yes, I know, work with me here - v6 is not dead yet). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|