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 » Is it necessary that correlID field length should be 24 ?

Post new topic  Reply to topic
 Is it necessary that correlID field length should be 24 ? « View previous topic :: View next topic » 
Author Message
dosttumhara1810
PostPosted: Fri Dec 03, 2010 12:44 am    Post subject: Is it necessary that correlID field length should be 24 ? Reply with quote

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
View user's profile Send private message
dosttumhara1810
PostPosted: Fri Dec 03, 2010 12:52 am    Post subject: Reply with quote

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
View user's profile Send private message
j.f.sorge
PostPosted: Fri Dec 03, 2010 12:57 am    Post subject: Reply with quote

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
View user's profile Send private message
dosttumhara1810
PostPosted: Fri Dec 03, 2010 1:01 am    Post subject: Reply with quote

Voyager

Joined: 01 Dec 2010
Posts: 76

then why am i getting the errorsaying expected length in correlID is 24.
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Fri Dec 03, 2010 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message
dosttumhara1810
PostPosted: Fri Dec 03, 2010 1:09 am    Post subject: Reply with quote

Voyager

Joined: 01 Dec 2010
Posts: 76

that mean by any means i need to give the length as 24.
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Fri Dec 03, 2010 1:12 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 03, 2010 1:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
dosttumhara1810
PostPosted: Fri Dec 03, 2010 1:30 am    Post subject: Reply with quote

Voyager

Joined: 01 Dec 2010
Posts: 76

Do i need to change CCSID then?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 03, 2010 1:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Fri Dec 03, 2010 5:30 am    Post subject: Reply with quote

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
View user's profile Send private message
rekarm01
PostPosted: Sat Dec 04, 2010 4:39 am    Post subject: Re: Is it necessary that correlID field length should be 24? Reply with quote

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
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 » Is it necessary that correlID field length should be 24 ?
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.