|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Solved] Having trouble associating a parser to an element |
« View previous topic :: View next topic » |
Author |
Message
|
dyevin |
Posted: Thu Dec 10, 2009 7:12 am Post subject: [Solved] Having trouble associating a parser to an element |
|
|
Novice
Joined: 27 May 2003 Posts: 11 Location: Phoenix, Arizona
|
Good day, all.
I'm trying to read a variable number of unformatted text messages from a queue, concatenate them into a single message, and write that message to a file. Message broker and toolkit are both at V6.1 and I'm doing this presently on Windows. Message flow looks as follows:
MQInput -> Collector -> Trace -> Compute -> Trace -> FileOutput
Compute node ESQL is:
Code: |
CREATE COMPUTE MODULE MainframetoFile_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
DECLARE personid CHARACTER;
DECLARE resptype CHARACTER;
DECLARE respliteral CHARACTER;
SET personid = CAST(SUBSTRING(InputRoot.Collection.In1.MQMD.CorrelId FROM 11 FOR 9) AS CHARACTER CCSID 500);
SET resptype = CAST(SUBSTRING(InputRoot.Collection.In1.MQMD.CorrelId FROM 20 FOR 1) AS CHARACTER CCSID 500);
CASE
WHEN resptype = '1' THEN
SET respliteral = 'ACQW';
WHEN resptype = '2' THEN
SET respliteral = 'AHQH';
WHEN resptype = '3' THEN
SET respliteral = 'AHSR';
WHEN resptype = '4' THEN
SET respliteral = 'KQ';
WHEN resptype = '5' THEN
SET respliteral = 'SORI';
END CASE;
SET OutputLocalEnvironment.Destination.File.Name = personid || '.' || respliteral || '.txt';
CREATE LASTCHILD OF Environment.Variables DOMAIN('BLOB') NAME('FullMessage');
CALL CopyEntireMessage();
RETURN TRUE;
END;
CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;
CREATE PROCEDURE CopyEntireMessage() BEGIN
DECLARE str BLOB;
DECLARE i INTEGER 1;
DECLARE j INTEGER;
SET j = CARDINALITY(InputRoot.Collection.In1[]);
WHILE i <= j DO
IF str IS NULL THEN
SET str = InputRoot.Collection.In1[i].BLOB.BLOB;
ELSE
SET str = str || InputRoot.Collection.In1[i].BLOB.BLOB;
END IF;
SET i = i + 1;
END WHILE;
SET Environment.Variables.FullMessage = str;
END;
END MODULE; |
Second trace contents:
( ['GENERICROOT' : 0x7f58950]
(0x01000000:Name):Properties = ( ['MQPROPERTYPARSER' : 0x3858d28]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'MQ' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
)
( ['MQROOT' : 0x7f58500]
(0x01000000:Name):Variables = (
(0x03000000:NameValue):FullMessage = X'4b512030303830315431302e415a2e545854204e414d2f56414445522c2044415254482020202020202020202020202020202020202e444f422f31393337303932332e5345582f4d4d56442e34302d3031204b522e30303830315431302e415a303038303130302e0d0a545854204e414d2f56414445522c2044415254482020202020202020202020202020202020202e444f422f31393337303932332e5345582f4d0d0a4e4f205245434f524420464f554e44' (BLOB)
)
)
In FileOutput node, the Data Location field of the Request tab is set to Environment.Variables.FullMessage.
The output file gets created, but with a zero length.
In the debug trace, I see the following:
BIP6068W: A request was made to serialize a bitstream from element ''FullMessage'' using parser ''none''. The result was zero bytes long.
The node or ESQL ASBITSTREAM function requested that an element serialize its bitstream and this resulted in no bytes being written.
If the output bitstream should not have been zero bytes long, ensure that the correct element was specified.
If the parser name is blank or set to a root parser, associate an owning parser with the element:
If created in ESQL, the DOMAIN clause of the CREATE statement can be used.
If created using the user-defined extension API use a method that allows a parser to be specified.
I believe that my problem stems from uncertainty about the CREATE ... DOMAIN statement in my ESQL. I've searched the forum looking for clues on how to associate the BLOB parser with element FullMessage but must be not understanding something.
Can someone point me in the right direction or offer any suggestions? Thanks!
Last edited by dyevin on Thu Dec 10, 2009 8:33 am; edited 1 time in total |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu Dec 10, 2009 7:42 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Shouldn't there be something like
Code: |
set OutputRoot.BLOB.BLOB = Environment.Variables.FullMessage;
|
At the end of your compute node?
The procedure CopyEntireMessage populates a variable in the Environment Folder but I don't see it being copied into the OutputRoot. (I could be midding something though...) _________________ 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 |
|
 |
dyevin |
Posted: Thu Dec 10, 2009 7:48 am Post subject: |
|
|
Novice
Joined: 27 May 2003 Posts: 11 Location: Phoenix, Arizona
|
Thanks, smdavies99.
I originally specified OutputRoot.BLOB.BLOB in my Compute node ESQL and with a corresponding entry in the Data Location field in the FileOutput node, but got the same result. I switched to using an Environment variable during my efforts to make my flow work. |
|
Back to top |
|
 |
fschofer |
Posted: Thu Dec 10, 2009 7:53 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
OutputRoot.BLOB.BLOB and Data Location $Body works for me.
Greetings
Frank |
|
Back to top |
|
 |
dyevin |
Posted: Thu Dec 10, 2009 8:06 am Post subject: |
|
|
Novice
Joined: 27 May 2003 Posts: 11 Location: Phoenix, Arizona
|
Thanks, Frank!
That did the trick. I don't believe I ever tried using $Body in the FileOutput node.
Thanks, everyone, for the quick responses. |
|
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
|
|
|
|