Author |
Message
|
starfish77 |
Posted: Tue Dec 09, 2003 7:55 am Post subject: User Defined attributes |
|
|
 Apprentice
Joined: 07 Nov 2003 Posts: 31 Location: USA
|
I am using MQ5.3 on AIX with visual age c++. I need to know if I can define my own attributes as a part of message. e.g. For every message I want to set the returnFlag=true for success and returnflag=false for failure.
Can I use msgFlags attribute for this???
Thanks, |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Dec 09, 2003 8:00 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The MsgFlags are used by MQ to determine message grouping and segmentation. I wouldn't suggest using them for your own purpose. |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Dec 09, 2003 8:02 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Dont think there is any that you could be customized.
Since you mentioned C++, why dont you define your own structure that has the MQ Structure that you want and a boolean/char variable to hold your value. That way you could set whatever you want whenever a message is delivered/failed.
Cheers
Kumar |
|
Back to top |
|
 |
starfish77 |
Posted: Tue Dec 09, 2003 8:09 am Post subject: |
|
|
 Apprentice
Joined: 07 Nov 2003 Posts: 31 Location: USA
|
Can you please direct me to some documentation on how to set and retrieve the MQ structures. Is it possible I can query for this flag on my receiving end( may be with matchoptions etc)?
Thanks, |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Dec 09, 2003 8:22 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
It's not in any documentation. Its OOPS. Here's an example for you to take clue from.
struct Mystruct
{
char *pBuffer;
char retVal;
} MyBuffer;
-
-
-
-
Pass MyBuffer in your Put app which will hold your message as well the return value in retVal, either Y or N. But since the success or failure of MQ api call is not known until its actually returned, you could use this retval to denote the success/failure of the previous put/get. You could as well set this to 'Y' for each message, assuming that the message if put would have Y anyways. This method could be dodgy and hence i am not suggesting this.
But as i mentioned earlier, there is no way you could achieve something like this using existing MQ Structures. You could tweak them and use for your own purpose, but that might hamper elsewhere.
Which all leads me to the question. Whats the purpose you plan to achieve with this. May be that would clarify the solution a little further.
Cheers
Kumar |
|
Back to top |
|
 |
starfish77 |
Posted: Tue Dec 09, 2003 12:19 pm Post subject: |
|
|
 Apprentice
Joined: 07 Nov 2003 Posts: 31 Location: USA
|
Oh..Ok..I thought there is some concept of MQ strcture..
thanks |
|
Back to top |
|
 |
|