Author |
Message
|
eswarnv |
Posted: Mon Aug 26, 2002 6:37 pm Post subject: Sending a message to multiple destinations??? |
|
|
Voyager
Joined: 20 Dec 2001 Posts: 88
|
Hi
Please suggest me on the following.
1) I want to write a message flow which sends an input message to multiple destinations depending on some condition?? What node i have to use and what properties i have to set??? I want to retrieve destinations from the database???? ( Not publish/subscribe )
2) I have a message flow with simple input node and output node. For ouput node how to specify target qmanager and queue dynamically???(thru esql, not in output node properties)
Thanks and Regards
Eswar |
|
Back to top |
|
 |
kirani |
Posted: Mon Aug 26, 2002 6:59 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
This topic has been discussed in this forum for many times. Please do a search for DestinationList and you will find the answer.
Following is the link to one of them ..
http://www.mqseries.net/phpBB2/viewtopic.php?t=4896 _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
eswarnv |
Posted: Tue Aug 27, 2002 5:43 pm Post subject: |
|
|
Voyager
Joined: 20 Dec 2001 Posts: 88
|
Hi Kiran,
Have gone thru the link and i found the following code,
Code: |
IF ( condition1) THEN
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'Q1'
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueManagerName = 'QMgr1';
ELSE
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueName = 'Q2'
SET OutputLocalEnvironment.Destination.MQ.DestinationData[1].queueManagerName = 'QMgr2';
END IF; |
My Question:
If i write above code in a compute node, then what is the target node for Compute Node and what properties to be set for that node..
Thanks and Regards
Eswar |
|
Back to top |
|
 |
lung |
Posted: Tue Aug 27, 2002 6:32 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
The queuename and queuemanager values u set is saved in the properties of the message, so from the Compute node you can basically direct it to any other node as long as the message headers are copied over.
For the properties of the output node, just make sure you set it to DestinationList and your message will end up in the queues as defined earlier in the Compute node. _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Tue Aug 27, 2002 6:55 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
lung wrote: |
The queuename and queuemanager values u set is saved in the properties of the message, so from the Compute node you can basically direct it to any other node as long as the message headers are copied over.
|
Actually, these values are stored into another tree (DestinationList/LocalEnvironment).
Eswar,
In this compute node, make sure you select "DestinationList/LocalEnvironment" as a part of Compute mode in Advanced tab. As Lung said, your MQOutput node should be configured to specify "Destination List" in advanced tab. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
lung |
Posted: Tue Aug 27, 2002 7:00 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Thanks for the correction, Kiran
Most of the time, I just select 'All' in the Advanced tab of my Compute node.  _________________ lung |
|
Back to top |
|
 |
kirani |
Posted: Tue Aug 27, 2002 8:56 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Lung,
This might create problems if you are setting your LocalEnvironment tree in one compute node and not copying it in further compute nodes. For example, conside this message flow:
MQInput->Compute1->Compute2->MQOutput
Let's say in Compute1 you are setting some variable in LocalEnvironment Tree using following ESQL code and you have selected "copy entire message".
Code: |
SET OutputLocalEnvironment.Variables.Myvar = 'ABC';
SET OutputRoot = InputRoot;
|
In Compute2, you are now setting the DestinationList using esql code mentioned in my earlier post. You have also selected "Copy entire message" here, which will insert following code into your Compute2 node:
SET OutputRoot = InputRoot;
Compute mode property for above 2 nodes is set to "All". There is no problem with first compute node, but your second compute node will do some "hidden tricks"!
Since you have not modified LocalEnvironment tree in Compute2 node, but by specifying compute mode to "All" you are telling broker that you have modified the LocalEnvironment/Message tree in this node. By setting Compute mode to some value (Message, LocalEnvironment, ...) you are taking the responsibility of copying/building that particular Output tree. So in your code, if you don't have following ESQL statement, you will receive empty LocalEnvironment tree after Compute2 node.
SET OutputLocalEnvironment = InputLocalEnvironment;
To solve this problem either select "Message" in Compute mode or add above ESQL statement to your Compute2 node and keep compute mode to "All". _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
lung |
Posted: Tue Aug 27, 2002 10:29 pm Post subject: |
|
|
 Master
Joined: 27 Aug 2002 Posts: 291 Location: Malaysia
|
Hmm. Got it. Thanks! _________________ lung |
|
Back to top |
|
 |
|