Author |
Message
|
KoGor |
Posted: Thu Feb 15, 2007 5:13 am Post subject: Generating multiple output messages |
|
|
Voyager
Joined: 09 Nov 2005 Posts: 81 Location: Moscow,Russia.
|
I have the message flow which do the following:
- gets a message from queue by MQInput
- in compute node
-- call a function that copy InputRoot headers (by modified CopyMessageHeaders function) to Environment.Variables.SDS.OutputRoot variable and then generate brand-new receipt message in Environment.Variables.SDS.OutputRoot.MRM field.
-- after that copy to content of Environment to OutputRoot
Code: |
SET OutputRoot = Environment.Variables.SDS.OutputRoot;
SET OutputRoot.Properties.MessageFormat = 'XML1';
SET OutputRoot.Properties.MessageSet = 'OI7LOK0002001';
SET OutputRoot.Properties.MessageType = 'Envelope';
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = UPPER(SenderQueueName);
PROPAGATE TO TERMINAL 'out1' FINALIZE DEFAULT DELETE NONE; |
Terminal 'out1' is connected to MQOutput node which has property "Destination mode" is set to "Destination list"
When PROPAGATE statement executes I get the exception:
"Text = Message contains no data" but I see in debug mode that there is a good Output message after compute node with all properties and headers set.
Could you tell me what I do wrong?
Then I have to put this receipt to DB2, so I need the message not to be discarded. And after that I have to proceed to the main message itself. I've chosen this order because it's my primary task to notify customer that message already in WMB even it would be failed in future processing.
Thank you in advance!
Konstantin Gorbunov |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 15, 2007 5:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If the message data is not serialized by an Output node, then likely the tree does not belong to a parser. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
KoGor |
Posted: Thu Feb 15, 2007 5:37 am Post subject: |
|
|
Voyager
Joined: 09 Nov 2005 Posts: 81 Location: Moscow,Russia.
|
Is there way to check or be ensured that MQOutput node is serialized the tree? All settings in MQOutput node are set by default except destination node. I think this must be trivial task but it doesn't work Should I use CREATE LASTCHILD with PARSER to create MRM field in Compute node? But in this case I have to encode Environment.Variables.SDS.OutputRoot with ASBITSTREAM at first. This another command that takes much hardware resources to call a parser and in CREATE LASTCHILD I also have to call a parser so it's better to avoid using such way. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 15, 2007 6:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No.
Just CREATE FIELD...DOMAIN. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 15, 2007 7:00 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You need
CREATE LASTCHILD OF Environment.Variables.XXXX DOMAIN 'MRM'...
Otherwise the environment tree is not associated with a parser ( the parser is not inherited from the source tree when you copy to the environment ). |
|
Back to top |
|
 |
KoGor |
Posted: Thu Feb 15, 2007 7:02 am Post subject: |
|
|
Voyager
Joined: 09 Nov 2005 Posts: 81 Location: Moscow,Russia.
|
I found the next sentence in ESQL documentation in description of CREATE statement:
"Do not specify the DOMAIN clause with the FIELD clause;"
So I decided to use CREATE LASTCHILD and modified my code:
Code: |
CALL GenerateReceipt(Environment.Variables.SDS.OutputRoot);
SET OutputRoot.MQMD.Format = 'MQSTR';
SET OutputRoot.MQMD.MsgFlags = 0;
SET OutputRoot.Properties.MessageFormat = 'XML1';
SET OutputRoot.Properties.MessageSet = 'OI7LOK0002001';
SET OutputRoot.Properties.MessageType = 'Envelope';
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = UPPER(SenderQueueName);
CREATE LASTCHILD OF OutputRoot DOMAIN 'MRM' NAME 'MRM';
SET OutputRoot.MRM = Environment.Variables.SDS.OutputRoot.MRM;
|
And it works now. Thank you for your help!
You are really guru in WMB!
2kimbert : Thank you too! I've understand where I was wrong.
P.S. Is this information in ESQL documentation? Unfortunately I don't have much experience in WMB. |
|
Back to top |
|
 |
|