Author |
Message
|
nathanw |
Posted: Thu Mar 03, 2005 4:18 am Post subject: CorrelId Resizing Possible? |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
During normal functionality the CorrelId is set to 24 characters long
As part of a solution with an external app look up we are looking at using the CorrelId as the reference point between input and output of messages by inputting our own value within.
The problem is with the messages is that the only unique value is 36 characters long.
I suppose my question is 2 fold
1) Is it possible to reset the length of CorrelId to a longer length
2)If it is possible how is it done
In 7 years of using MQ and associated programs i have not had a coause to do this before as 24 has normally been enough
Any ideas
Thanks in advance |
|
Back to top |
|
 |
KeeferG |
Posted: Thu Mar 03, 2005 4:58 am Post subject: |
|
|
 Master
Joined: 15 Oct 2004 Posts: 215 Location: Basingstoke, UK
|
As you state the correlid is of type MQBYTE24. As far as I know this cannot be changed as it would offset the rest of the fields and screw up parsing of the MQMD.
Im not sure how you will get around this. _________________ Keith Guttridge
-----------------
Using MQ since 1995 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 03, 2005 5:13 am Post subject: Re: CorrelId Resizing Possible? |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
nathanw wrote: |
As part of a solution with an external app look up we are looking at using the CorrelId as the reference point between input and output of messages by inputting our own value within. |
Everyone who has ever tried this has ended up with pain and suffering - in my experience.
Use either the ApplIdentityData, or the AccountingToken instead. They're 32 bytes instead of 24. Except you said you needed 36, not 32. So use both and allow for future growth!
OR use an MQRFH2 header, and populate the usr folder with the data you need.
Or if you really can't do either of those, just put some stuff at the front of the message with an easy to find seperator to distinguish it from the rest of the body.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
clindsey |
Posted: Thu Mar 03, 2005 5:46 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
Quote: |
Or if you really can't do either of those, just put some stuff at the front of the message with an easy to find seperator to distinguish it from the rest of the body.
|
If you really cannot do either of these and you have absolute control of the correlId and msgId from end to end, you can use msgId and correlId to get 48 bytes. This is especially easy in C language because the 2 are in contiguous memory. You just treat the msgId field as though it were 48 bytes. This assumes the MQMD header will never change and I think that is a pretty safe assumption.
Charlie |
|
Back to top |
|
 |
nathanw |
Posted: Thu Mar 03, 2005 6:37 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
Many thanks guys
Obviously this is a matter that has caused problems before for other consultants.
In a way i am curious that the fields have not been set to variable or longer length before now as more amor ethese days corporations ar eusing longer values for UUID properties etc.
I suppose most have got round the matter by adding a field at the start with the longer value inside and just responding with that value.
Am interested in clindsey reponse about lengthening the field with a C app. The header will not change and the values entered will only ever be these values or smaller.
Do you have any further info on this?
many thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Mar 03, 2005 7:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Most UUIDs or GUIDs with 32 in length contain some form of datetime encryption. Now MQ generates its own DateTime Stamp.
If you can extract that information from your UID and use the rest to create the Correlation ID why not ?
An other possibility would be to misuse GroupID. I would have to check for the length but off the bat I don't believe it to be longer than MessageID.
Enjoy  |
|
Back to top |
|
 |
clindsey |
Posted: Thu Mar 03, 2005 7:06 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
Quote: |
Am interested in clindsey reponse about lengthening the field with a C app. The header will not change and the values entered will only ever be these values or smaller.
|
Actually, I was refering to the message header (MQMD). Look at cmqc.h in the <mqm>\tools\c\include directory.
Code: |
struct tagMQMD {
.
.
MQLONG Persistence; /* Message persistence */
MQBYTE24 MsgId; /* Message identifier */
MQBYTE24 CorrelId; /* Correlation identifier */
MQLONG BackoutCount; /* Backout counter */
.
.
};
|
MsgId and CorrelId occupy 48 consecutive bytes of memory. So you can use a call like
Code: |
memcpy(md.MsgId, pMyId, 48)
|
and the contents of pMyid are copied to the MsgId and CorrelId fields. Certainly this is not "best practice" and if you don't understand what this is doing, then definitely don't use it in your code.
Charlie |
|
Back to top |
|
 |
nathanw |
Posted: Thu Mar 03, 2005 7:13 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
Yes i see what you mean and to be honest I am not comfortable in doing that.
i am waiting info back on the actual structure of the field I am using for correlId and if I can just take 24 chars out of that then I will
If not i will split the 36 between Msgid and CorrelId within broker as I write the message and when i get the response I will concatenate them back into a single value. for final message build.
Thanks for input
BTW saper groupId is also 24 good idea tho |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 03, 2005 7:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You are a lot less likely to run into trouble misusing ApplIdentityData and AccountingToken than you are misusing MsgId and CorrId. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Mar 03, 2005 7:26 am Post subject: Re: CorrelId Resizing Possible? |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
jefflowrey wrote: |
OR use an MQRFH2 header, and populate the usr folder with the data you need. |
I think that you might want to look at Jeff's comments a little more. If you are going to start messing with things like the GroupID, then I assume that you have no intention of ever sending messages in a group? You could always go with the RFH2 and put in it exactly what you want. |
|
Back to top |
|
 |
EddieA |
Posted: Thu Mar 03, 2005 9:54 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Please stop using the word characters when referring to MessageID and CorrelationID. They are byte strings. And as such, do not get converted between character sets. So, if you have a mix of ASCII and EBCDIC machines you could be in even deeper trouble using these fields.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
nathanw |
Posted: Fri Mar 04, 2005 12:59 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
EddieA wrote: |
Please stop using the word characters when referring to MessageID and CorrelationID. They are byte strings. And as such, do not get converted between character sets. So, if you have a mix of ASCII and EBCDIC machines you could be in even deeper trouble using these fields.
Cheers, |
apologies if i did that but if yu see inmost of my threads i am actually referring to the length of values i am inputting into the field
a couple of times i misquoted but will endeavour to do better |
|
Back to top |
|
 |
|