|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Question on PROPOGATE statement |
« View previous topic :: View next topic » |
Author |
Message
|
ribs2011 |
Posted: Fri Nov 25, 2011 11:32 am Post subject: Question on PROPOGATE statement |
|
|
Newbie
Joined: 25 Nov 2011 Posts: 5
|
The msgflow goes as mentioned below:
MQInput >> Database1 >> Database2 >>(OUT1) RouteToLabel1
>>(OUT2) RouteToLabel2
label1 >> MQOutput1
label2 >> MQOutput2
label3 >> MQOutput3
ESQL for Datebase1 :
------------------
CREATE DATABASE MODULE DATABASE1
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET LocalEnvironment.Destination.RouterList.DestinationData[1].LabelName = 'label1';
SET LocalEnvironment.Destination.RouterList.DestinationData[2].LabelName = 'label2';
SET LocalEnvironment.Destination.RouterList.DestinationData[2].LabelName = 'label3';
RETURN TRUE;
END;
END MODULE;
ESQL for Datebase2 :
------------------
CREATE DATABASE MODULE DATABASE2
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
PROPAGATE TO TERMINAL 'out';
PROPAGATE TO TERMINAL 'out1';
RETURN FALSE;
END;
END MODULE;
**Mode property of both the RouteToLabel nodes are configured for 'Route to Last'
a. Drive the flow by putting any message
b. At Database1 node the LocalEnvironment variables will be assigned
c. At Database2 node the first Propogate statement gets executed and the message goes through the OUT1 terminal to RouteToLabel1 node. As per the mode property, the RouteToLabel node routes the message to label3 and removes this entry.
At this point the DestinationList in the LocalEnvironment tree shows only 2 entries, label1 and label2.
d. Now, the control comes back to Database2 node and executes the Propogate 2 statement. At this point the LocalEnvironment again shows the DestinationList having label3 which was deleted in point c by RouteToLabel node. And the message goes through the OUT2 terminal and to RouteToLabel2 node and the RouteToLabel node again routes it to label3 and removes it.
Question:
---------
At point c, the first RouteToLabel node routes the message to label3 and removes the last entry, label3. But when the control again reaches the next Propogate statement, again we get the original LocalEnvironment tree with label3 in it.
My guess here is that the Propogate statement only propogates a copy of the message from the buffer and when the control returns, we again get the unmodified message tree. Is this true ? Else can some one explain on this behaviour.
Thanks in advance !! |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Nov 25, 2011 11:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
PROPAGATE is a subroutine call to the next node. When the next node returns, you have unwound the stack. |
|
Back to top |
|
 |
ribs2011 |
Posted: Fri Nov 25, 2011 11:58 am Post subject: |
|
|
Newbie
Joined: 25 Nov 2011 Posts: 5
|
Thanks for the quick reply.
So, does that mean the Propogate statement splits the message and propogates a copy of the message to the subsequent nodes and any changes done to the LocalEnvironment during the course of a PROPOGATE statement will only be applicable to that particular copy of the message and we will have the original LocalEnvironment to work with when the next node returns the control after PROPOGATE ?
a. PROPAGATE TO TERMINAL 'out'; ===> takes a copy of the message. Delete an element from the LocalEnvironment
b. When the control returns after executing point a.
c. PROPAGATE TO TERMINAL 'out1'; ===> Will we have the original LocalEnvironment tree ?? |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Nov 25, 2011 3:41 pm Post subject: Re: Question on PROPOGATE statement |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
ribs2011 wrote: |
My guess here is that the Propogate statement only propogates a copy of the message from the buffer and when the control returns, we again get the unmodified message tree. Is this true? |
No. The Database2 node propagates its LocalEnvironment tree, the RouteToLabel node makes a copy, deletes an element from the copy, and propagates the copy downstream. When control returns to the Database2 node, it still has its original, unmodified LocalEnvironment. |
|
Back to top |
|
 |
ribs2011 |
Posted: Sat Nov 26, 2011 10:55 am Post subject: |
|
|
Newbie
Joined: 25 Nov 2011 Posts: 5
|
Thanks much for correcting me and explaining the behavior of RouteToLabel node. |
|
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
|
|
|
|