Author |
Message
|
kumar.shanj |
Posted: Thu Dec 02, 2010 10:42 am Post subject: How to put parts of a message into multiple queues |
|
|
Apprentice
Joined: 18 Nov 2010 Posts: 49
|
I am retrieving multiple rows from the Database and based on the value of a value in each row,i want to put that message row data into various different queues.
Ex : I am retrieving 5 row of data from database and in each row of data, a column called country as "UK" or "Poland" will be there.
Based on country data i need to put that entire row data into different queue.
Please help in this regard. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Dec 02, 2010 10:50 am Post subject: Re: How to put parts of a message into multiple queues |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kumar.shanj wrote: |
Please help in this regard. |
I'd use the mechanism you finally got to work here if I were you. Putting the PROPAGATE back in of course.
Calculating which queue relates to which column value is a simple piece of code. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kumar.shanj |
Posted: Fri Dec 03, 2010 4:41 am Post subject: |
|
|
Apprentice
Joined: 18 Nov 2010 Posts: 49
|
Below pasted is my code
CREATE COMPUTE MODULE IntrastatFlowControl
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
--CALL CopyMessageHeaders();
--CALL CopyEntireMessage();
DECLARE count INTEGER;
DECLARE i INTEGER;
DECLARE RIRID INTEGER;
--Through SQL
SET Environment.Variables.Data.RIRREPORTS[] =
(SELECT * FROM
Database.dbo.RunWebsphereReport AS Rwr);
SET count = CARDINALITY(Environment.Variables.Data.RIRREPORTS[]);
SET i = 1;
--SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'TAX.INTRASTAT.UK.INP';
--SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueManagerName = 'UK_CSERV_DW02';
WHILE (i<=count) do
--CALL CopyMessageHeaders();
SET OutputRoot.XMLNSC.Data.RunReport=Environment.Variables.Data.RIRREPORTS[i];
CASE OutputRoot.XMLNSC.Data.RunReport[i].ReportType
WHEN 1 THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'TAX.INTRASTAT.UK.INP';
WHEN 2 THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'TAX.INTRASTAT.POL.INP';
END CASE;
-- Set header values
PROPAGATE;
--PROPAGATE;
SET i = i+1;
END WHILE;
RETURN TRUE;
END;
And i am getting a exception message like
(
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbComputeNode.cpp'
(0x03000000):Line = 464
(0x03000000):Function = 'ImbComputeNode::evaluate'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'com/pwc/intrastat/flow/control/IntrastatFlowControl#FCMComposite_1_8.com/pwc/aim/commonerrorhandler/CommonErrorHandler#FCMComposite_1_3'
(0x03000000):Label = 'com.pwc.intrastat.flow.control.IntrastatFlowControl.CommonErrorHandler.Format Exception Message'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x03000000):Text = 'Caught exception and rethrowing'
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp'
(0x03000000):Line = 589
(0x03000000):Function = 'SqlStatementGroup::execute'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'com/pwc/intrastat/flow/control/IntrastatFlowControl#FCMComposite_1_8.com/pwc/aim/commonerrorhandler/CommonErrorHandler#FCMComposite_1_3'
(0x03000000):Label = 'com.pwc.intrastat.flow.control.IntrastatFlowControl.CommonErrorHandler.Format Exception Message'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2488
(0x03000000):Text = 'Error detected, rethrowing'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'com.pwc.aim.commonerrorhandler.FormatExceptionMessage.Main'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '94.3'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'PROPAGATE TO TERMINAL 'out1' FINALIZE DEFAULT DELETE DEFAULT;'
)
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x03000000):Line = 782
(0x03000000):Function = 'ImbMqOutputNode::evaluate'
(0x03000000):Type = 'ComIbmMQOutputNode'
(0x03000000):Name = 'com/pwc/intrastat/flow/control/IntrastatFlowControl#FCMComposite_1_8.com/pwc/aim/commonerrorhandler/CommonErrorHandler#FCMComposite_1_25'
(0x03000000):Label = 'com.pwc.intrastat.flow.control.IntrastatFlowControl.CommonErrorHandler.Failure Queue'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x03000000):Text = 'Caught exception and rethrowing'
(0x01000000):MessageException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x03000000):Line = 1955
(0x03000000):Function = 'ImbMqOutputNode::putMessage'
(0x03000000):Type = 'ComIbmMQOutputNode'
(0x03000000):Name = 'com/pwc/intrastat/flow/control/IntrastatFlowControl#FCMComposite_1_8.com/pwc/aim/commonerrorhandler/CommonErrorHandler#FCMComposite_1_25'
(0x03000000):Label = 'com.pwc.intrastat.flow.control.IntrastatFlowControl.CommonErrorHandler.Failure Queue'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2666
(0x03000000):Text = 'Failed to open queue'
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '-1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'MQW101'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '2085'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = ''
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = ''
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = ''
)
)
)
)
)
)
Please help me in this regard |
|
Back to top |
|
 |
joebuckeye |
Posted: Fri Dec 03, 2010 5:27 am Post subject: |
|
|
 Partisan
Joined: 24 Aug 2007 Posts: 365 Location: Columbus, OH
|
Your exception does not come from the code you posted as the PROPAGATE statements are very different.
Please also read up on the PROPAGATE statement to make sure you understand how it works and what values should be used for what you are trying to do.
I would also bet you are going to have one more message than you expect generated by this ESQL. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Dec 03, 2010 5:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And please use code tags when posting code!!!!!!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
rbicheno |
Posted: Fri Dec 03, 2010 5:49 am Post subject: |
|
|
Apprentice
Joined: 07 Jul 2009 Posts: 43
|
As per reply above check the propagate doc, its pretty clear, a number of product samples also act as good references for your task, largemessage sample uses propagate and message routing will show you how to set the output dynamically too.
Your actual error suggests the queue for the output node is unknown which is likely to be one of:
-your q names are wrong
- you are not setting the compute mode properly to send the local env you setup
- you may not have the mode set to destination list on the mqoutput node |
|
Back to top |
|
 |
|