|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ResetContent descriptor and Asbitstream+parse |
« View previous topic :: View next topic » |
Author |
Message
|
JunnyJose |
Posted: Thu May 10, 2018 1:31 am Post subject: ResetContent descriptor and Asbitstream+parse |
|
|
Newbie
Joined: 10 May 2018 Posts: 3
|
Can somebody help me to understand the below topics clearly ?
Is reset content descriptor and Asbitstream+parse does the same functionality?Can somebody explain clearly about this two topics?
If so why it is recommended to use Asbitream+parse instead of ResetContentDescriptor to avoid performance hit?
Does the below code only validates the message while converting to bitstream or it parses as well ?
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
DECLARE Test BLOB;
DECLARE opts INTEGER BITOR(RootBitStream,
ValidateContent,
ValidateValue,
ValidateFullConstraints,
ValidateException,
ValidateComplete);
SET Test = ASBITSTREAM(InputRoot.*[<] OPTIONS opts
ENCODING COALESCE(InputRoot.Properties.Encoding, 0)
CCSID COALESCE(InputRoot.Properties.CodedCharSetId, 0)
SET InputRoot.Properties.MessageSet
TYPE InputRoot.Properties.MessageType
FORMAT InputRoot.Properties.MessageFormat);
RETURN TRUE;
END; |
|
Back to top |
|
 |
timber |
Posted: Thu May 10, 2018 3:44 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Good question.
ResetContentDescriptor does this:
1. Serialize the input message tree (i.e. do what an output node would do, and create a BLOB from it using whatever parser is attached to InputRoot.*[>] )
2. Parse the resulting BLOB using the parser/model specified in the RCD node properties
3. Optionally (if requested on the RCD node properties) validate while parsing
ASBITSTREAM followed by CREATE...PARSE is similar, but a little more flexible:
1. ASBITSTREAM: Serialize whatever input message tree was specified to create a BLOB
2. CREATE...PARSE: Parse the BLOB using the parser/model specified in the ESQL statement.
3. Optionall (if requested in the CREATE...PARSE flags) validate while parsing
Quote: |
why it is recommended to use Asbitream+parse instead of ResetContentDescriptor to avoid performance hit? |
That's not a Golden Rule of Message Flow Design. It it sometimes more efficient to reduce the number of nodes in the message flow to avoid the overhead of repeatedly copying the message tree. But Donald Knuth's well-known rule applies: "Premature optimisation is the root of all evil". I would advise you to design your message flows to be readable and maintainable, and only optimise when you need to. |
|
Back to top |
|
 |
JunnyJose |
Posted: Thu May 10, 2018 5:14 am Post subject: |
|
|
Newbie
Joined: 10 May 2018 Posts: 3
|
Thanks a lot for the detailed explanation. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|