Author |
Message
|
dosttumhara1810 |
Posted: Fri Dec 03, 2010 12:44 am Post subject: Is it necessary that correlID field length should be 24 ? |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
Hi all,
I want to set my user defined correlID with the message in the compute node, but it gives exceptiopn saying that correlID expected lengthis 24. So when i Pad the CorrelID with 0 to make the length 24 or increase th elength of correl id in compute node then it works fine.
I am using MQ 7.0 and MB 6.1 .
Is it mandatory to have correlID length 24 |
|
Back to top |
|
 |
dosttumhara1810 |
Posted: Fri Dec 03, 2010 12:52 am Post subject: |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
i am using this command to set user defined correlID
SET ABC = 'Account_Details';
SET OutputRoot.MQMD.CorrelId = CAST(ABC AS BLOB CCSID 1208);
But this gives error
and when i use
SET ABC = ''Account_Details000000000';
SET OutputRoot.MQMD.CorrelId = CAST(ABC AS BLOB CCSID 1208);
It works fine..
Is there anything to do with CCSID here. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Fri Dec 03, 2010 12:57 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
When using ESQL the length of the CorrelId must be exactly 48 bytes / 24 characters. Java MQ API fills the length automatically. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
dosttumhara1810 |
Posted: Fri Dec 03, 2010 1:01 am Post subject: |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
then why am i getting the errorsaying expected length in correlID is 24. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Fri Dec 03, 2010 1:06 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
dosttumhara1810 wrote: |
then why am i getting the errorsaying expected length in correlID is 24. |
Expected length in CHARACTER is 24. If you convert it into BLOB it will get 48. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
dosttumhara1810 |
Posted: Fri Dec 03, 2010 1:09 am Post subject: |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
that mean by any means i need to give the length as 24. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Fri Dec 03, 2010 1:12 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
dosttumhara1810 wrote: |
that mean by any means i need to give the length as 24. |
Yes! But you may append for example X'00' to the BLOB CorrelId until it's byte-length is 48. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 03, 2010 1:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And as you are using CCSID 1208 you may need to be careful when using multibyte characters because your number of bytes is limited to 24.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dosttumhara1810 |
Posted: Fri Dec 03, 2010 1:30 am Post subject: |
|
|
Voyager
Joined: 01 Dec 2010 Posts: 76
|
Do i need to change CCSID then? |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 03, 2010 1:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dosttumhara1810 wrote: |
Do i need to change CCSID then? |
That's up to you  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 03, 2010 5:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dosttumhara1810 wrote: |
Do i need to change CCSID then? |
You certainly need to be aware of it. One of the reasons what you're doing is discouraged as a best practice is that the string "Account_Details" (or whatever really goes in there!) will look different on different platforms. So if (for example) a mainframe takes your correl id & interprets it as a string, it'll be unreadable because the hex won't convert back into readable EBCDIC.
So whatever's using your correl id needs to be aware of, able to use and happy to use the code page it was encoded with.
It's because of those 3 points most people (and best practice) uses a system generated hex string & puts business data (like account details) elsewhere. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sat Dec 04, 2010 4:39 am Post subject: Re: Is it necessary that correlID field length should be 24? |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
j.f.sorge wrote: |
When using ESQL the length of the CorrelId must be exactly 48 bytes / 24 characters. |
No. The length of CorrelId is exactly 24 bytes.
CorrelId contains only bytes, not characters. Whether the bytes happen to represent characters or some other type of data is up to the application; it's outside the scope of MQ.
If an application chooses to convert a character string (stored elsewhere) into a byte string, then the resulting byte string might need padding or truncating, to fit into the exactly 24-byte CorrelId.
If an application chooses to convert an exactly 24-byte CorrelId into a character string (stored elsewhere), then the resulting character length would be <= 24 characters; the exact number depends on the ccsid. |
|
Back to top |
|
 |
|