Author |
Message
|
smdavies99 |
Posted: Wed Sep 02, 2015 1:06 am Post subject: V7 to V9 ASBITSTREAM Gotcha |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
During a migration from V7 to V9 I noticed a problem with this bit of ESQL
Code: |
IF COALESCE(InputProperties.MessageSet,'') = '' THEN
SET msgBlob = ASBITSTREAM (InputBody
ENCODING COALESCE(InputProperties.Encoding, 546)
CCSID COALESCE(InputProperties.CodedCharSetId,1208));
ELSE
IF COALESCE(InputProperties.MessageFormat,'') = '' THEN
SET msgBlob = ASBITSTREAM (InputBody
ENCODING COALESCE(InputProperties.Encoding, 546)
CCSID COALESCE(InputProperties.CodedCharSetId,1208)
SET InputProperties.MessageSet
TYPE InputProperties.MessageType );
-- FORMAT InputProperties.MessageFormat);
ELSE
SET msgBlob = ASBITSTREAM (InputBody
ENCODING COALESCE(InputProperties.Encoding, 546)
CCSID COALESCE(InputProperties.CodedCharSetId,1208)
SET InputProperties.MessageSet
TYPE InputProperties.MessageType
FORMAT InputProperties.MessageFormat);
END IF;
END IF;
|
This is in out Output Message Auditing framework.
For 99% of our flows there is no problem. But for one that just processes in input message and updates a database there was nothing in the InputBody. It was NULL.
In MB V7.0.0.4 this didn't cause any issues. But in V9.0.0.3 the code threw an exception on thr ASBITSTREAM.
This was it was trying to ASBITSTREAM a different folder. I think it is the MQMD.
Adding something so that the InputBody was not null solved the issue.
It might be a bug but I'm not sure. It might be that with the older version didn't throw an error and things are now that much tighter and it is doing what it is supposed to be doing all along.
I'm posting this here so that others might benefit from the 'gotcha' in future. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 02, 2015 5:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm reasonably sure that InputBody points to the last child of InputRoot, regardless of whether that's associated with a message parser or not.
So if the last child of InputRoot is MQMD, then that's what *should* be sent to ASBITSTREAM.
It might be easiet to just change the program triggering this flow to send some fixed data in the message, rather than no data at all. (The program writing the MQ message) _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Sep 02, 2015 5:27 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The Lastchild is what I thought. The code I showed is in a common Audit Framework.
I've modified the code to look to see if the InputBody is actually pointing at real data or not. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
ksrocks9 |
Posted: Wed Sep 02, 2015 7:44 am Post subject: |
|
|
Apprentice
Joined: 11 Mar 2015 Posts: 35
|
I am getting the same problem in 9.0.0.3. In MB V7, it's working fine. I used ASBITSTREAM in tracking. Now in my tracking it's processing the message, but nothing in the body. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 02, 2015 7:48 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
It really sounds like a bug in MB v7.
Or at least an odd behavior that was resolved in later versions.
InputBody should point to the last child of InputRoot. This should be the message headers if the message had no content. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Sep 02, 2015 8:00 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
It really sounds like a bug in MB v7.
Or at least an odd behavior that was resolved in later versions.
InputBody should point to the last child of InputRoot. This should be the message headers if the message had no content. |
I went back to the V7 broker and tested it. The InputRoot was NULL there as well but the AsBitstream didn't throw an error. Instead it produced a zero length blob.
As I said before, I put a test to see if there was indeed something recognisble in the Body Tree. If not the code I posted above was bypassed. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|